Parcourir la source

Amended user management list views

master
Lene Scholtz il y a 5 ans
Parent
révision
46c9c6225d

+ 48
- 184
src/components/admin/status/agentsUserManagementPage.vue Voir le fichier

@@ -41,221 +41,85 @@
41 41
       </div>
42 42
     </div>
43 43
     <div class="container">
44
-      <div class="d-flex justify-content-between">
45
-        <div class="p-2">
46
-          <input v-model="searchItem" class="form-control" placeholder="Search ..." />
47
-        </div>
48
-      </div>
49
-      <div v-if="Delete === true">
50
-        <alert :text="'Private User removed successfully'" :type="'SUCCESS'" />
51
-      </div>
52
-      <br />
53
-      <table class="table table-bordered">
54
-        <thead>
55
-          <tr>
56
-            <td colspan="11">
57
-              <div class="myWell">
58
-                <h4>Agents</h4>
59
-              </div>
60
-            </td>
61
-          </tr>
62
-          <tr>
63
-            <th>
64
-              <b>ID</b>
65
-            </th>
66
-            <th>
67
-              <b>Name</b>
68
-            </th>
69
-            <th>
70
-              <b>Surname</b>
71
-            </th>
72
-            <th>
73
-              <b>Cell Number</b>
74
-            </th>
75
-            <th>
76
-              <b>Telephone Number</b>
77
-            </th>
78
-            <th>
79
-              <b>Email</b>
80
-            </th>
81
-            <th>
82
-              <b>Role</b>
83
-            </th>
84
-            <th>
85
-              <b>Reset Password</b>
86
-            </th>
87
-            <th>
88
-              <b>Modify</b>
89
-            </th>
90
-            <th>
91
-              <b>Remove</b>
92
-            </th>
93
-            <th>
94
-              <b>Soft Delete</b>
95
-            </th>
96
-          </tr>
97
-        </thead>
98
-        <tbody>
99
-          <tr v-for="(item, i) in DisplayItems" :key="i">
100
-            <td>{{ item.id }}</td>
101
-            <td>{{ item.name }}</td>
102
-            <td>{{ item.surname }}</td>
103
-            <td>{{ item.cellNumber }}</td>
104
-            <td>{{ item.telephone }}</td>
105
-            <td>{{ item.email }}</td>
106
-            <td v-if="item.user">{{ item.user.role }}</td>
107
-            <td v-else></td>
108
-            <td>
109
-              <button type="button" class="btn" style="margin:2px; color: #60CBEB">Reset</button>
110
-            </td>
111
-            <td>
112
-              <button
113
-                type="button"
114
-                class="btn"
115
-                style="margin:2px; color: #60CBEB"
116
-                @click="routerGoTo('/user/updateProfileInfo')"
117
-              >Edit</button>
118
-            </td>
119
-            <td>
120
-              <button
121
-                type="button"
122
-                @click="Delete(item.id)"
123
-                class="btn"
124
-                style="width: 85px; height:40px; color:#60CBEB"
125
-              >Delete</button>
126
-            </td>
127
-            <td>{{ item.isDeleted}}</td>
128
-          </tr>
129
-        </tbody>
130
-      </table>
131
-      <div class="d-flex justify-content-between">
132
-        <div class="p-1">{{ currentPage + ' / ' + PageCount }}</div>
133
-        <div class="p-1">
134
-          <BasePagination
135
-            :currentPage="currentPage"
136
-            :pageCount="PageCount"
137
-            @nextPage="pageChangeHandle('next')"
138
-            @previousPage="pageChangeHandle('previous')"
139
-            @loadPage="pageChangeHandle"
140
-          />
141
-        </div>
142
-      </div>
44
+      <ListView
45
+        :items="agents"
46
+        :showNew="false"
47
+        :editable="true"
48
+        :deleteable="true"
49
+        :showCustomAction="true"
50
+        :showColumnChooser="false"
51
+        :CustomActionHeading="'Reset Password'"
52
+        :displayColumns="columns"
53
+        :displayHeaders="headers"
54
+        @onEdit="Edit"
55
+        @onDelete="Delete"
56
+        @onResetPassword="PasswordReset"
57
+      />
143 58
     </div>
144 59
     <br />
145 60
   </div>
146 61
 </template>
147 62
 
148 63
 <script>
149
-import { mapState, mapActions } from 'vuex';
150
-import axios from 'axios';
151
-import _ from 'lodash';
152
-import ItemsPerPageList from '../../../assets/staticData/itemsPerPage';
153
-import BasePagination from '../../shared/basePagination.vue';
154
-import Agency from '../../user/registerAgencySection.vue';
155
-import alert from '../../shared/alert.vue';
64
+import { mapState, mapActions } from "vuex";
65
+import axios from "axios";
66
+import Agency from "../../user/registerAgencySection.vue";
67
+import alert from "../../shared/alert.vue";
68
+import ListView from "../../shared/listView.vue";
156 69
 
157 70
 export default {
158
-  name: 'agentManagementPage',
71
+  name: "agentManagementPage",
159 72
   components: {
160
-    BasePagination,
73
+    ListView,
161 74
     Agency,
162
-    alert,
75
+    alert
163 76
   },
164 77
   props: {
165
-    delete: Boolean,
78
+    delete: Boolean
166 79
   },
167 80
   data() {
168 81
     return {
169
-      sortKey: '',
170
-      reverse: false,
171
-      searchItem: '',
172
-      itemsPerPageList: ItemsPerPageList,
173
-      visibleItemsPerPageCount: 0,
174
-      currentPage: 1,
175
-      item: {},
82
+      columns: [
83
+        "id",
84
+        "name",
85
+        "surname",
86
+        "cellNumber",
87
+        "telephone",
88
+        "email",
89
+        "isDeleted"
90
+      ],
91
+      headers: ["", "", "", "", "", "", "", "ResetPwd", "Modify", "Remove"],
92
+      item: {}
176 93
     };
177 94
   },
178 95
   methods: {
179
-    ...mapActions('register', ['getAgents', 'deleteAgent']),
96
+    ...mapActions("register", ["getAgents", "deleteAgent"]),
180 97
     addNewAgent({ commit }) {
181 98
       axios
182
-        .post('/api/agent')
183
-        .then(result => commit('saveAgent', result.data))
99
+        .post("/api/agent")
100
+        .then(result => commit("saveAgent", result.data))
184 101
         .catch(console.error);
185 102
     },
186 103
     routerGoTo(goTo) {
187 104
       this.$router.push(goTo);
188 105
     },
189
-    sortBy(sortKey) {
190
-      this.reverse = this.sortKey === sortKey ? !this.reverse : false;
191
-      this.sortKey = sortKey;
192
-    },
193
-    async pageChangeHandle(value) {
194
-      console.log(value);
195
-      switch (value) {
196
-        case 'next':
197
-          this.currentPage += 1;
198
-          break;
199
-        case 'previous':
200
-          this.currentPage -= 1;
201
-          break;
202
-        default:
203
-          this.currentPage = value;
204
-      }
205
-    },
206
-    onChangeItemsPerPage() {
207
-      if (this.currentPage !== 1) {
208
-        this.currentPage = 1;
209
-      }
210
-    },
211
-    Delete(id) {
212
-      this.deleteAgent(id);
106
+    Edit(item) {
107
+      this.$router.push({
108
+        path: "/user/updateProfileInfo",
109
+        query: { id: item.id }
110
+      });
213 111
     },
112
+    Delete(item) {
113
+      this.deleteAgent(item.id);
114
+    }
214 115
   },
215 116
   mounted() {
216 117
     this.getAgents();
217
-    try {
218
-      // to assign initial value to itemsPerPage
219
-      if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
220
-        const [startItem] = this.itemsPerPageList;
221
-        this.visibleItemsPerPageCount = startItem;
222
-      }
223
-    } catch (error) {
224
-      throw error;
225
-    }
226 118
   },
227 119
   computed: {
228
-    ...mapState('register', ['agents', 'removeAgent']),
229
-
230
-    SortDirection() {
231
-      return this.reverse ? 'desc' : 'asc';
232
-    },
233
-    PageCount() {
234
-      return this.visibleItemsPerPageCount !== 0
235
-        ? Math.ceil(this.FilteredItems.length / this.visibleItemsPerPageCount)
236
-        : 1;
237
-    },
238
-    FilteredItems() {
239
-      const list = _.filter(this.agents, item => Object.values(item).some(
240
-          i => JSON.stringify(i)
241
-              .toLowerCase()
242
-              .indexOf(this.searchItem) > -1,
243
-        ),);
244
-      return _.orderBy(list, this.sortKey, this.SortDirection);
245
-    },
246
-    DisplayItems() {
247
-      const list = this.FilteredItems;
248
-      const startSlice = (this.currentPage - 1) * this.visibleItemsPerPageCount;
249
-      let endSlice = this.currentPage * this.visibleItemsPerPageCount;
250
-      if (endSlice > list.length) {
251
-        endSlice = list.length;
252
-      }
253
-      return list.slice(startSlice, endSlice);
254
-    },
255
-  },
120
+    ...mapState("register", ["agents", "removeAgent"])
121
+  }
256 122
 };
257 123
 </script>
258 124
 
259
-
260
-<style>
261
-</style>
125
+<style></style>

+ 42
- 176
src/components/admin/status/userManagementPage.vue Voir le fichier

@@ -23,207 +23,73 @@
23 23
       </div>
24 24
     </div>
25 25
     <div class="container">
26
-      <div class="d-flex justify-content-between">
27
-        <div class="p-2">
28
-          <input v-model="searchItem" class="form-control" placeholder="Search ..." />
29
-        </div>
30
-      </div>
31
-      <div v-if="Delete === true">
32
-        <alert :text="'Private User removed successfully'" :type="'SUCCESS'" />
33
-      </div>
34
-      <br />
35
-      <table class="table table-bordered">
36
-        <thead>
37
-          <tr>
38
-            <td colspan="11">
39
-              <div class="myWell">
40
-                <h4>Private Users</h4>
41
-              </div>
42
-            </td>
43
-          </tr>
44
-          <tr>
45
-            <th>
46
-              <b>ID</b>
47
-            </th>
48
-            <th>
49
-              <b>Name</b>
50
-            </th>
51
-            <th>
52
-              <b>Surname</b>
53
-            </th>
54
-            <th>
55
-              <b>Cell Number</b>
56
-            </th>
57
-            <th>
58
-              <b>Telephone Number</b>
59
-            </th>
60
-            <th>
61
-              <b>Email</b>
62
-            </th>
63
-            <th>
64
-              <b>Role</b>
65
-            </th>
66
-            <th>
67
-              <b>Reset Password</b>
68
-            </th>
69
-            <th>
70
-              <b>Modify</b>
71
-            </th>
72
-            <th>
73
-              <b>Remove</b>
74
-            </th>
75
-            <th>
76
-              <b>Soft Delete</b>
77
-            </th>
78
-          </tr>
79
-        </thead>
80
-        <tbody>
81
-          <tr v-for="(item, i) in DisplayItems" :key="i">
82
-            <td>{{ item.id }}</td>
83
-            <td>{{ item.name }}</td>
84
-            <td>{{ item.surname }}</td>
85
-            <td>{{ item.cellNumber }}</td>
86
-            <td>{{ item.telephone }}</td>
87
-            <td>{{ item.email }}</td>
88
-            <td v-if="item.user">{{ item.user.role }}</td>
89
-            <td v-else></td>
90
-            <td>
91
-              <button type="button" class="btn" style="margin:2px; color: #60CBEB">Reset</button>
92
-            </td>
93
-            <td>
94
-              <button
95
-                type="button"
96
-                class="btn"
97
-                style="margin:2px; color: #60CBEB"
98
-                @click="routerGoTo('/user/updateProfileInfo')"
99
-              >Edit</button>
100
-            </td>
101
-            <td>
102
-              <button
103
-                type="button"
104
-                @click="Delete(item.id)"
105
-                class="btn"
106
-                style="margin:2px; color: #60CBEB"
107
-              >Delete</button>
108
-            </td>
109
-            <td>{{ item.isDeleted }}</td>
110
-          </tr>
111
-        </tbody>
112
-      </table>
113
-      <div class="d-flex justify-content-between">
114
-        <div class="p-1">{{ currentPage + ' / ' + PageCount }}</div>
115
-        <div class="p-1">
116
-          <BasePagination
117
-            :currentPage="currentPage"
118
-            :pageCount="PageCount"
119
-            @nextPage="pageChangeHandle('next')"
120
-            @previousPage="pageChangeHandle('previous')"
121
-            @loadPage="pageChangeHandle"
122
-          />
123
-        </div>
124
-      </div>
26
+      <ListView
27
+        :items="individuals"
28
+        :showNew="false"
29
+        :editable="true"
30
+        :deleteable="true"
31
+        :showCustomAction="true"
32
+        :showColumnChooser="false"
33
+        :CustomActionHeading="'Reset Password'"
34
+        :displayColumns="columns"
35
+        :displayHeaders="headers"
36
+        @onEdit="Edit"
37
+        @onDelete="Delete"
38
+        @onResetPassword="PasswordReset"
39
+      />
125 40
       <br />
126 41
     </div>
127 42
   </div>
128 43
 </template>
129 44
 
130 45
 <script>
131
-import { mapState, mapActions } from 'vuex';
132
-import _ from 'lodash';
133
-import ItemsPerPageList from '../../../assets/staticData/itemsPerPage';
134
-import BasePagination from '../../shared/basePagination.vue';
135
-import alert from '../../shared/alert.vue';
46
+import { mapState, mapActions } from "vuex";
47
+import alert from "../../shared/alert.vue";
48
+import ListView from "../../shared/listView.vue";
136 49
 
137 50
 export default {
138
-  name: 'userManagementPage',
51
+  name: "userManagementPage",
139 52
   components: {
140
-    BasePagination,
141
-    alert,
53
+    ListView,
54
+    alert
142 55
   },
143 56
   data() {
144 57
     return {
145
-      sortKey: '',
146
-      reverse: false,
147
-      searchItem: '',
148
-      itemsPerPageList: ItemsPerPageList,
149
-      visibleItemsPerPageCount: 0,
150
-      currentPage: 1,
151
-      item: {},
58
+      columns: [
59
+        "id",
60
+        "name",
61
+        "surname",
62
+        "cellNumber",
63
+        "telephone",
64
+        "email",
65
+        "isDeleted"
66
+      ],
67
+      headers: ["", "", "", "", "", "", ""],
68
+      item: {}
152 69
     };
153 70
   },
154 71
   props: {},
155 72
   methods: {
156
-    ...mapActions('register', ['getIndividuals', 'deleteIndividual']),
73
+    ...mapActions("register", ["getIndividuals", "deleteIndividual"]),
157 74
     routerGoTo(goTo) {
158 75
       this.$router.push(goTo);
159 76
     },
160
-    sortBy(sortKey) {
161
-      this.reverse = this.sortKey === sortKey ? !this.reverse : false;
162
-      this.sortKey = sortKey;
163
-    },
164
-    async pageChangeHandle(value) {
165
-      console.log(value);
166
-      switch (value) {
167
-        case 'next':
168
-          this.currentPage += 1;
169
-          break;
170
-        case 'previous':
171
-          this.currentPage -= 1;
172
-          break;
173
-        default:
174
-          this.currentPage = value;
175
-      }
176
-    },
177
-    onChangeItemsPerPage() {
178
-      if (this.currentPage !== 1) {
179
-        this.currentPage = 1;
180
-      }
181
-    },
182
-    Delete(id) {
183
-      this.deleteIndividual(id);
77
+    Edit(item) {
78
+      this.$router.push({
79
+        path: "/user/updateProfileInfo",
80
+        query: { id: item.id }
81
+      });
184 82
     },
83
+    Delete(item) {
84
+      this.deleteIndividual(item.id);
85
+    }
185 86
   },
186 87
   mounted() {
187 88
     this.getIndividuals();
188
-    try {
189
-      // to assign initial value to itemsPerPage
190
-      if (this.itemsPerPageList && this.itemsPerPageList.length > 0) {
191
-        const [startItem] = this.itemsPerPageList;
192
-        this.visibleItemsPerPageCount = startItem;
193
-      }
194
-    } catch (error) {
195
-      throw error;
196
-    }
197 89
   },
198 90
   computed: {
199
-    ...mapState('register', ['individuals', 'removeIndividual']),
200
-
201
-    SortDirection() {
202
-      return this.reverse ? 'desc' : 'asc';
203
-    },
204
-    PageCount() {
205
-      return this.visibleItemsPerPageCount !== 0
206
-        ? Math.ceil(this.FilteredItems.length / this.visibleItemsPerPageCount)
207
-        : 1;
208
-    },
209
-    FilteredItems() {
210
-      const list = _.filter(this.individuals, item => Object.values(item).some(
211
-          i => JSON.stringify(i)
212
-              .toLowerCase()
213
-              .indexOf(this.searchItem) > -1,
214
-        ),);
215
-      return _.orderBy(list, this.sortKey, this.SortDirection);
216
-    },
217
-    DisplayItems() {
218
-      const list = this.FilteredItems;
219
-      const startSlice = (this.currentPage - 1) * this.visibleItemsPerPageCount;
220
-      let endSlice = this.currentPage * this.visibleItemsPerPageCount;
221
-      if (endSlice > list.length) {
222
-        endSlice = list.length;
223
-      }
224
-      return list.slice(startSlice, endSlice);
225
-    },
226
-  },
91
+    ...mapState("register", ["individuals", "removeIndividual"])
92
+  }
227 93
 };
228 94
 </script>
229 95
 

+ 28
- 26
src/store/modules/user/authentication.js Voir le fichier

@@ -1,7 +1,7 @@
1
-import Vue from 'vue';
2
-import Vuex from 'vuex';
3
-import axios from 'axios';
4
-import log from '../../../assets/Log';
1
+import Vue from "vue";
2
+import Vuex from "vuex";
3
+import axios from "axios";
4
+import log from "../../../assets/Log";
5 5
 
6 6
 Vue.use(Vuex);
7 7
 export default {
@@ -13,21 +13,21 @@ export default {
13 13
     token: undefined,
14 14
     user: undefined,
15 15
     person: undefined,
16
-    agency: undefined,
16
+    agency: undefined
17 17
   },
18 18
   mutations: {
19 19
     auth_request(state) {
20
-      state.status = 'loading';
20
+      state.status = "loading";
21 21
     },
22 22
     auth_success(state, user) {
23
-      state.status = 'success';
23
+      state.status = "success";
24 24
       state.token = user.token;
25 25
       state.user = user.user;
26 26
       state.person = user.person;
27 27
       state.agency = user.agency;
28 28
     },
29 29
     auth_error(state) {
30
-      state.status = 'error';
30
+      state.status = "error";
31 31
     },
32 32
     logout(state) {
33 33
       state.status = undefined;
@@ -45,52 +45,54 @@ export default {
45 45
     },
46 46
     updateFlag(state) {
47 47
       state.flag = true;
48
-    },
48
+    }
49 49
   },
50 50
   getters: {
51 51
     authStatus: state => state.status,
52 52
     getPerson: () => log.getPerson(),
53
-    getUser: () => log.getUser(),
53
+    getUser: () => log.getUser()
54 54
   },
55 55
   actions: {
56 56
     init({ commit }) {
57
+      console.log(log);
57 58
       if (!log.isLoggedIn() && log.tokenExpired) {
58 59
         log.clearValues();
59 60
       } else log.updateTokenExpiry();
60
-      commit('runInit', {
61
-        user: log.getJSONObject('user'),
62
-        token: log.getJSONObject('token'),
63
-        person: log.getJSONObject('person'),
64
-        agency: log.getJSONObject('agency'),
61
+      commit("runInit", {
62
+        user: log.getJSONObject("user"),
63
+        token: log.getJSONObject("token"),
64
+        person: log.getJSONObject("person"),
65
+        agency: log.getJSONObject("agency")
65 66
       });
66 67
     },
67 68
     login({ commit }, user) {
68 69
       axios({
69
-        url: '/api/register/authenticate',
70
+        url: "/api/register/authenticate",
70 71
         data: {
71 72
           username: user.username,
72
-          password: user.password,
73
+          password: user.password
73 74
         },
74
-        method: 'POST',
75
+        method: "POST"
75 76
       })
76
-        .then((resp) => {
77
+        .then(resp => {
77 78
           log.clearValues();
78 79
           log.setValues(resp.data);
79 80
 
80
-          commit('auth_success', resp.data);
81
+          commit("auth_success", resp.data);
82
+          console.log(JSON.stringify(resp.data));
81 83
         })
82
-        .catch((err) => {
83
-          commit('auth_error');
84
+        .catch(err => {
85
+          commit("auth_error");
84 86
           log.clearValues();
85
-          commit('auth_error', err.data);
87
+          commit("auth_error", err.data);
86 88
         });
87 89
     },
88 90
     logout({ commit }) {
89 91
       return new Promise(() => {
90
-        commit('logout');
92
+        commit("logout");
91 93
         log.clearValues();
92 94
         delete axios.defaults.headers.common.Authorization;
93 95
       });
94
-    },
95
-  },
96
+    }
97
+  }
96 98
 };

+ 52
- 50
src/store/modules/user/register.js Voir le fichier

@@ -1,4 +1,4 @@
1
-import axios from 'axios';
1
+import axios from "axios";
2 2
 
3 3
 export default {
4 4
   namespaced: true,
@@ -6,26 +6,27 @@ export default {
6 6
     individuals: [],
7 7
     agents: [],
8 8
     registerIndividual: {
9
-      name: '',
10
-      surname: '',
11
-      email: '',
12
-      cellNumber: '',
13
-      username: '',
14
-      password: '',
9
+      name: "",
10
+      surname: "",
11
+      email: "",
12
+      cellNumber: "",
13
+      username: "",
14
+      password: ""
15 15
     },
16 16
     registerAgency: {
17
-      name: '',
18
-      eaabeffcNumber: '',
19
-      companyRegNumber: '',
17
+      name: "",
18
+      eaabeffcNumber: "",
19
+      companyRegNumber: "",
20 20
       user: {
21
-        name: '',
22
-        surname: '',
23
-        email: '',
24
-        cellNumber: '',
25
-        username: '',
26
-        password: '',
27
-      },
28
-    },
21
+        name: "",
22
+        surname: "",
23
+        email: "",
24
+        cellNumber: "",
25
+        username: "",
26
+        password: "",
27
+        role: ""
28
+      }
29
+    }
29 30
   },
30 31
   mutations: {
31 32
     setIndividual(state, type) {
@@ -55,31 +56,32 @@ export default {
55 56
     },
56 57
     updateAgency(state, type) {
57 58
       state.registerAgency.find(item => item.id === type.id).eaabeffcNumber = type.eaabeffcNumber;
58
-      state.registerAgency.find(item => item.id === type.id).companyRegNumber =        type.companyRegNumber;
59
+      state.registerAgency.find(item => item.id === type.id).companyRegNumber =
60
+        type.companyRegNumber;
59 61
     },
60 62
     clearIndividual(state) {
61 63
       state.registerIndividual = {
62
-        name: '',
63
-        surname: '',
64
-        email: '',
65
-        cellNumber: '',
66
-        username: '',
67
-        password: '',
64
+        name: "",
65
+        surname: "",
66
+        email: "",
67
+        cellNumber: "",
68
+        username: "",
69
+        password: ""
68 70
       };
69 71
     },
70 72
     clearAgency(state) {
71 73
       state.registerAgency = {
72
-        name: '',
73
-        eaabeffcNumber: '',
74
-        companyRegNumber: '',
74
+        name: "",
75
+        eaabeffcNumber: "",
76
+        companyRegNumber: "",
75 77
         user: {
76
-          name: '',
77
-          surname: '',
78
-          email: '',
79
-          cellNumber: '',
80
-          username: '',
81
-          password: '',
82
-        },
78
+          name: "",
79
+          surname: "",
80
+          email: "",
81
+          cellNumber: "",
82
+          username: "",
83
+          password: ""
84
+        }
83 85
       };
84 86
     },
85 87
     removeIndividual(state, id) {
@@ -90,20 +92,20 @@ export default {
90 92
     },
91 93
     removeAgent(state, id) {
92 94
       state.registerAgency.pop(state.registerAgency.find(a => a.id === id));
93
-    },
95
+    }
94 96
   },
95 97
   getters: {},
96 98
   actions: {
97 99
     getIndividuals({ commit }) {
98 100
       axios
99
-        .get('/api/individual')
100
-        .then(result => commit('setIndividuals', result.data))
101
+        .get("/api/individual")
102
+        .then(result => commit("setIndividuals", result.data))
101 103
         .catch(console.error);
102 104
     },
103 105
     getAgents({ commit }) {
104 106
       axios
105
-        .get('/api/agent')
106
-        .then(result => commit('setAgents', result.data))
107
+        .get("/api/agent")
108
+        .then(result => commit("setAgents", result.data))
107 109
         .catch(console.error);
108 110
     },
109 111
     // getAgency({
@@ -117,20 +119,20 @@ export default {
117 119
 
118 120
     saveIndividual({ commit }, item) {
119 121
       axios
120
-        .post('/api/register/register', item)
121
-        .then(result => commit('addIndividual', result.data))
122
+        .post("/api/register/register", item)
123
+        .then(result => commit("addIndividual", result.data))
122 124
         .catch(console.error);
123 125
     },
124 126
     saveAgency({ commit }, item) {
125 127
       axios
126
-        .post('/api/register/registeragency', item)
127
-        .then(result => commit('addAgency', result.data))
128
+        .post("/api/register/registeragency", item)
129
+        .then(result => commit("addAgency", result.data))
128 130
         .catch(console.error);
129 131
     },
130 132
     saveAgent({ commit }, item) {
131 133
       axios
132
-        .post('/api/agent', item)
133
-        .then(result => commit('addAgent', result.data))
134
+        .post("/api/agent", item)
135
+        .then(result => commit("addAgent", result.data))
134 136
         .catch(console.error);
135 137
     },
136 138
     // updateIndividual({
@@ -162,15 +164,15 @@ export default {
162 164
     deleteIndividual({ commit }, id) {
163 165
       axios
164 166
         .delete(`/api/individual/${id}`)
165
-        .then(result => commit('removeIndividual', id))
167
+        .then(result => commit("removeIndividual", id))
166 168
         .catch(console.error);
167 169
     },
168 170
     deleteAgent({ commit }, id) {
169 171
       axios
170 172
         .delete(`/api/agent/${id}`)
171
-        .then(result => commit('removeAgent', id))
173
+        .then(result => commit("removeAgent", id))
172 174
         .catch(console.error);
173
-    },
175
+    }
174 176
     // deleteAgency({
175 177
     //   commit,
176 178
     // }, id) {
@@ -179,5 +181,5 @@ export default {
179 181
     //     .then(result => commit('removeAgency', id))
180 182
     //     .catch(console.error);
181 183
     // },
182
-  },
184
+  }
183 185
 };

Chargement…
Annuler
Enregistrer