Browse Source

Timeshare sell edit & error fix

master
30117125 4 years ago
parent
commit
e9bab33e68

BIN
dist.zip View File


+ 6
- 3
src/components/admin/property/propertyList.vue View File

18
       <div class="row">
18
       <div class="row">
19
         <br />
19
         <br />
20
       </div>
20
       </div>
21
-      <div class="row">
22
-        <div class="col-lg-12">
21
+
22
+      <div v-if="wait" id="preloader"></div>
23
+    </div>
24
+    <div class="container-fluid">
25
+      <div class="row justify-content-center">
26
+        <div class="col-auto">
23
           <table class="table table-striped table-responsive">
27
           <table class="table table-striped table-responsive">
24
             <thead>
28
             <thead>
25
               <tr>
29
               <tr>
136
           </div>
140
           </div>
137
         </div>
141
         </div>
138
       </div>
142
       </div>
139
-      <div v-if="wait" id="preloader"></div>
140
     </div>
143
     </div>
141
   </section>
144
   </section>
142
 </template>
145
 </template>

+ 0
- 1
src/components/admin/status/editTimeShareAdminPage.vue View File

235
                       v-model="depDateParam"
235
                       v-model="depDateParam"
236
                     />
236
                     />
237
                   </float-label>
237
                   </float-label>
238
-
239
                   <div class="validation"></div>
238
                   <div class="validation"></div>
240
                 </div>
239
                 </div>
241
                 <div class="form-group col-md-6 mt-2">
240
                 <div class="form-group col-md-6 mt-2">

+ 6
- 6
src/components/admin/status/timeshareAdminList.vue View File

203
       "deleteListing"
203
       "deleteListing"
204
     ]),
204
     ]),
205
     Publish(item) {
205
     Publish(item) {
206
-      // var today = new Date();
207
-      // var dd = String(today.getDate()).padStart(2, "0");
208
-      // var mm = String(today.getMonth() + 1).padStart(2, "0"); //January is 0!
209
-      // var yyyy = today.getFullYear();
210
-      // item.pulbishedDate = today.toISOString().substring(0, 19);
211
-      // item.publish = true;
206
+      var today = new Date();
207
+      var dd = String(today.getDate()).padStart(2, "0");
208
+      var mm = String(today.getMonth() + 1).padStart(2, "0"); //January is 0!
209
+      var yyyy = today.getFullYear();
210
+      item.pulbishedDate = today.toISOString().substring(0, 19);
211
+      item.publish = true;
212
       // item.status.id = 26;
212
       // item.status.id = 26;
213
       // item.status.code = "FS";
213
       // item.status.code = "FS";
214
       // item.status.description = "For Sale";
214
       // item.status.description = "For Sale";

+ 2
- 2
src/components/shared/navBar.vue View File

6
     <div>
6
     <div>
7
       <header id="header" style="width: 100%; position: fixed; top:0px; z-index: 50;">
7
       <header id="header" style="width: 100%; position: fixed; top:0px; z-index: 50;">
8
         <div class="container">
8
         <div class="container">
9
-          <div class="row">
9
+          <div class="row justify-content-center">
10
             <div id="logo" class="col-md-3 col-xs-4 pull-left">
10
             <div id="logo" class="col-md-3 col-xs-4 pull-left">
11
               <a href="/">
11
               <a href="/">
12
                 <img
12
                 <img
111
                       <li>
111
                       <li>
112
                         <router-link to="/timeshare/faq">FAQ</router-link>
112
                         <router-link to="/timeshare/faq">FAQ</router-link>
113
                       </li>
113
                       </li>
114
-                      <li v-if="weekCount > 0">
114
+                      <li>
115
                         <hr />
115
                         <hr />
116
                         <router-link to="/timeshare/myWeeks">My Timeshare Weeks</router-link>
116
                         <router-link to="/timeshare/myWeeks">My Timeshare Weeks</router-link>
117
                       </li>
117
                       </li>

+ 9
- 5
src/components/timeshare/myWeeksPage.vue View File

160
 </template>
160
 </template>
161
 <script>
161
 <script>
162
 /* eslint-disable */
162
 /* eslint-disable */
163
-import { mapState, mapActions } from "vuex";
163
+import { mapState, mapActions, mapGetters } from "vuex";
164
 import Log from "../../assets/Log";
164
 import Log from "../../assets/Log";
165
 import ListView from "../shared/listView.vue";
165
 import ListView from "../shared/listView.vue";
166
 import BasePagination from "../shared/basePagination";
166
 import BasePagination from "../shared/basePagination";
211
       ]
211
       ]
212
     };
212
     };
213
   },
213
   },
214
-  mounted() {
215
-    this.getItems(Log.getUser().id);
214
+  created() {
215
+    this.getItems(Log.getUser().id).then(() => {
216
+      this.wait = false;
217
+    });
216
   },
218
   },
219
+  mounted() {},
217
   computed: {
220
   computed: {
221
+    ...mapGetters({ getNeedsVerify: "myWeeks/getNeedsVerify" }),
218
     ...mapState("myWeeks", ["items"]),
222
     ...mapState("myWeeks", ["items"]),
219
     FilteredListings() {
223
     FilteredListings() {
220
       if (this.filter) {
224
       if (this.filter) {
221
-        const list = _.filter(this.items, item =>
225
+        const list = _.filter(this.getNeedsVerify, item =>
222
           Object.values(item).some(
226
           Object.values(item).some(
223
             i =>
227
             i =>
224
               JSON.stringify(i)
228
               JSON.stringify(i)
228
         );
232
         );
229
         return _.orderBy(list, this.sortKey, this.SortDirection);
233
         return _.orderBy(list, this.sortKey, this.SortDirection);
230
       } else {
234
       } else {
231
-        return _.orderBy(this.items, this.sortKey, this.SortDirection);
235
+        return _.orderBy(this.getNeedsVerify, this.sortKey, this.SortDirection);
232
       }
236
       }
233
     },
237
     },
234
     PageCount() {
238
     PageCount() {

+ 4
- 2
src/components/timeshare/sell/contentSection.vue View File

809
                   type="number"
809
                   type="number"
810
                   step="any"
810
                   step="any"
811
                   name="commission"
811
                   name="commission"
812
-                  v-model="sellItem.agentCommission"
812
+                  v-model="sellItem.agentCommision"
813
                   placeholder="R"
813
                   placeholder="R"
814
                 />
814
                 />
815
                 <div class="validation"></div>
815
                 <div class="validation"></div>
1050
         this.sellItem.ownerObject = this.indiv;
1050
         this.sellItem.ownerObject = this.indiv;
1051
         //console.log(this.sellItem.ownerObject);
1051
         //console.log(this.sellItem.ownerObject);
1052
         console.log(this.sellItem);
1052
         console.log(this.sellItem);
1053
-        if (!this.boolError)
1053
+        console.log(JSON.stringify(this.sellItem));
1054
+        if (!this.boolError) {
1054
           this.saveWeek(this.sellItem)
1055
           this.saveWeek(this.sellItem)
1055
             .then(fulfilled => {
1056
             .then(fulfilled => {
1056
               // this.$router.push({ name: "PaymentOption", params: { week: fulfilled } });
1057
               // this.$router.push({ name: "PaymentOption", params: { week: fulfilled } });
1061
               this.errorOccurred = "ERRORHTML";
1062
               this.errorOccurred = "ERRORHTML";
1062
               this.errorMessage = ex;
1063
               this.errorMessage = ex;
1063
             });
1064
             });
1065
+        }
1064
       } else {
1066
       } else {
1065
         this.$router.push("/user/login");
1067
         this.$router.push("/user/login");
1066
       }
1068
       }

+ 29
- 27
src/components/timeshare/sell/contentSectionPF.vue View File

29
                       name="agency"
29
                       name="agency"
30
                       v-model="sellItem.agencyId"
30
                       v-model="sellItem.agencyId"
31
                     >
31
                     >
32
+                      <option value=""></option>
32
                       <option v-for="(item, i) in agencies" :key="i" :value="item.id">
33
                       <option v-for="(item, i) in agencies" :key="i" :value="item.id">
33
                         {{ item.agencyName }}
34
                         {{ item.agencyName }}
34
                       </option>
35
                       </option>
43
                       v-model="sellItem.agentId"
44
                       v-model="sellItem.agentId"
44
                       :disabled="!sellItem.agencyId"
45
                       :disabled="!sellItem.agencyId"
45
                     >
46
                     >
47
+                      <option value=""></option>
46
                       <option
48
                       <option
47
                         v-for="(item, i) in displayNotDeletedAgents"
49
                         v-for="(item, i) in displayNotDeletedAgents"
48
                         :key="i"
50
                         :key="i"
313
             <h2>Detailed Individual Information</h2>
315
             <h2>Detailed Individual Information</h2>
314
           </div>
316
           </div>
315
           <div class="form">
317
           <div class="form">
318
+            <div class="row mb-4">
319
+              <div class="col-md-12">
320
+                <float-label label="OWNER TYPE" fixed>
321
+                  <select class="form-control uniSelect" name="" id="" v-model="selectedUserType">
322
+                    <option value="myself">MYSELF</option>
323
+                    <option value="custom">CUSTOM USER</option>
324
+                  </select>
325
+                </float-label>
326
+              </div>
327
+            </div>
316
             <div class="row mb-2">
328
             <div class="row mb-2">
317
               <div class="form-group col-md-6">
329
               <div class="form-group col-md-6">
318
                 <float-label>
330
                 <float-label>
389
                     >
401
                     >
390
                   </span>
402
                   </span>
391
 
403
 
392
-                  <float-label label="Marital Status" style="width: 100%">
404
+                  <float-label fixed label="Marital Status" style="width: 100%">
393
                     <select
405
                     <select
394
                       class="form-control uniSelect"
406
                       class="form-control uniSelect"
395
                       id="howMarried"
407
                       id="howMarried"
396
                       v-model="indiv.howMarried"
408
                       v-model="indiv.howMarried"
397
                     >
409
                     >
398
-                      <option value="N/A">N/A</option>
399
-                      <option value="In Community Of Property">
400
-                        In Community Of Property
401
-                      </option>
402
-                      <option value="Out of Community Of Property">
403
-                        Out of Community Of Property
404
-                      </option>
405
-                      <option value="Other">Other</option>
406
-                      <option value="Traditional Wedding">
407
-                        Traditional Wedding
408
-                      </option>
409
-                      <option value="Single">Single</option>
410
-                      <option value="Divorced">Divorced</option>
411
-                      <option value="Widow">Widow</option>
412
-                      <option value="Committed Relationship">
413
-                        Committed Relationship
414
-                      </option>
415
-                      <option value="Partner">Partner</option>
410
+                      <option v-bind:value="0">N/A</option>
411
+                      <option v-bind:value="1">In Community Of Property</option>
412
+                      <option v-bind:value="2">Out of Community Of Property</option>
413
+                      <option v-bind:value="3">Other</option>
414
+                      <option v-bind:value="4">Traditional Wedding</option>
415
+                      <option v-bind:value="5">Single</option>
416
+                      <option v-bind:value="6">Divorced</option>
417
+                      <option v-bind:value="7">Widow</option>
418
+                      <option v-bind:value="8">Committed Relationship</option>
419
+                      <option v-bind:value="9">Partner</option>
416
                     </select>
420
                     </select>
417
                   </float-label>
421
                   </float-label>
418
                 </div>
422
                 </div>
445
                     placeholder="Cell Number"
449
                     placeholder="Cell Number"
446
                     data-rule="minlen:4"
450
                     data-rule="minlen:4"
447
                     data-msg="Please enter your cell number"
451
                     data-msg="Please enter your cell number"
448
-                    v-model="indiv.cellNumner"
452
+                    v-model="indiv.cellNumber"
449
                   />
453
                   />
450
                 </float-label>
454
                 </float-label>
451
 
455
 
468
               </div>
472
               </div>
469
             </div>
473
             </div>
470
           </div>
474
           </div>
471
-          <div v-if="indiv.howMarried === 'In Community Of Property'" class="section-header">
475
+          <div v-if="indiv.howMarried === 1" class="section-header">
472
             <h2>Spouse Details</h2>
476
             <h2>Spouse Details</h2>
473
           </div>
477
           </div>
474
-          <div v-if="indiv.howMarried === 'In Community Of Property'" class="form">
478
+          <div v-if="indiv.howMarried === 1" class="form">
475
             <div class="form-row mb-2">
479
             <div class="form-row mb-2">
476
               <div class="form-group col-md-6 mt-2">
480
               <div class="form-group col-md-6 mt-2">
477
                 <float-label>
481
                 <float-label>
805
                   type="number"
809
                   type="number"
806
                   step="any"
810
                   step="any"
807
                   name="commission"
811
                   name="commission"
808
-                  v-model="sellItem.agentCommission"
812
+                  v-model="sellItem.agentCommision"
809
                   placeholder="R"
813
                   placeholder="R"
810
                 />
814
                 />
811
                 <div class="validation"></div>
815
                 <div class="validation"></div>
830
                 </p>
834
                 </p>
831
               </div>
835
               </div>
832
             </div>
836
             </div>
833
-            <div class="form-row" v-if="profileEmailError">
837
+            <div class="form-row">
834
               <div class="col-md-12">
838
               <div class="col-md-12">
835
-                <p class="alert myError">
836
-                  Please ensure that your email is correct before adding a timeshare week.
837
-                </p>
839
+                <alert :text="errorMessage" :type="errorOccurred" />
838
               </div>
840
               </div>
839
             </div>
841
             </div>
840
             <div class="text-center col-12" v-if="CanSave">
842
             <div class="text-center col-12" v-if="CanSave">

+ 11
- 7
src/components/user/loginPage.vue View File

9
                 <div class="card card-signin my-5">
9
                 <div class="card card-signin my-5">
10
                   <div class="card-body">
10
                   <div class="card-body">
11
                     <h3 class="card-title text-center">Login</h3>
11
                     <h3 class="card-title text-center">Login</h3>
12
-                    <div v-if="error">
13
-                      <alert
14
-                        :text="'User doesn\'t exist or Username and Password is incorrect'"
15
-                        :type="'ERROR'"
16
-                      />
17
-                    </div>
12
+
13
+                    <alert :text="errorMessage" :type="errorOccurred" />
14
+
18
                     <div v-if="page">
15
                     <div v-if="page">
19
                       <alert :text="page.text" :type="'INFO'" />
16
                       <alert :text="page.text" :type="'INFO'" />
20
                     </div>
17
                     </div>
100
     return {
97
     return {
101
       username: "",
98
       username: "",
102
       password: "",
99
       password: "",
100
+      errorOccurred: "",
101
+      errorMessage: "",
103
       isPasswordShown: "password",
102
       isPasswordShown: "password",
104
       selectItems: [{ text: "password", value: 0 }],
103
       selectItems: [{ text: "password", value: 0 }],
105
       selectErrors: "Some error with the field",
104
       selectErrors: "Some error with the field",
129
       this.login({ username: this.username, password: this.password })
128
       this.login({ username: this.username, password: this.password })
130
         .then(() => {
129
         .then(() => {
131
           // console.log(Log.getUser());
130
           // console.log(Log.getUser());
131
+
132
           if (!this.page) {
132
           if (!this.page) {
133
             if (!Log.getUser().loginPasswordChange) {
133
             if (!Log.getUser().loginPasswordChange) {
134
               this.$router.push("/");
134
               this.$router.push("/");
140
           }
140
           }
141
         })
141
         })
142
         .catch(err => {
142
         .catch(err => {
143
-          this.error = true;
143
+          console.log(err.status);
144
+          if (err.status === 401) {
145
+            this.errorOccurred = "ERROR";
146
+            this.errorMessage = err.data.message;
147
+          }
144
         });
148
         });
145
     },
149
     },
146
     checkUserStatus() {
150
     checkUserStatus() {

+ 3
- 3
src/components/user/registerAgencySection.vue View File

144
       </div>
144
       </div>
145
     </div>
145
     </div>
146
     <button
146
     <button
147
-      :data-target="'#myModalAgency'"
148
-      data-toggle="modal"
149
       v-if="registerAgency.user.acceptedTerms"
147
       v-if="registerAgency.user.acceptedTerms"
150
       v-on:click="SubmitData()"
148
       v-on:click="SubmitData()"
151
       class="btn-solid-blue"
149
       class="btn-solid-blue"
163
     >
161
     >
164
       Cancel
162
       Cancel
165
     </button>
163
     </button>
164
+    <button hidden :data-target="'#myModalAgency'" data-toggle="modal" ref="dataToggle"></button>
166
   </div>
165
   </div>
167
 </template>
166
 </template>
168
 
167
 
220
           if (Log.getUser().role !== "Super Admin") {
219
           if (Log.getUser().role !== "Super Admin") {
221
             this.$router.push("/user/login");
220
             this.$router.push("/user/login");
222
           } else {
221
           } else {
222
+            this.$refs.dataToggle.click();
223
             this.$router.go();
223
             this.$router.go();
224
           }
224
           }
225
-        }, 2500);
225
+        }, 500);
226
       });
226
       });
227
       //this.$router.push("/user/login");
227
       //this.$router.push("/user/login");
228
     },
228
     },

+ 3
- 3
src/components/user/registerIndividual.vue View File

111
         </div>
111
         </div>
112
       </div>
112
       </div>
113
       <button
113
       <button
114
-        :data-target="'#myNewUserModal'"
115
-        data-toggle="modal"
116
         :disabled="isDisabled"
114
         :disabled="isDisabled"
117
         v-on:click="SubmitData()"
115
         v-on:click="SubmitData()"
118
         :class="isDisabled ? 'btn-disabled' : 'btn-solid-blue'"
116
         :class="isDisabled ? 'btn-disabled' : 'btn-solid-blue'"
130
       >
128
       >
131
         Cancel
129
         Cancel
132
       </button>
130
       </button>
131
+      <button hidden :data-target="'#myModalAgency'" data-toggle="modal" ref="dataToggle"></button>
133
     </div>
132
     </div>
134
   </main>
133
   </main>
135
 </template>
134
 </template>
203
             if (Log.getUser().role !== "Super Admin") {
202
             if (Log.getUser().role !== "Super Admin") {
204
               this.$router.push("/user/login");
203
               this.$router.push("/user/login");
205
             } else {
204
             } else {
205
+              this.$refs.dataToggle.click();
206
               this.$router.go();
206
               this.$router.go();
207
             }
207
             }
208
-          }, 2500);
208
+          }, 500);
209
         })
209
         })
210
         .catch(err => {
210
         .catch(err => {
211
           this.boolUserExists = true;
211
           this.boolUserExists = true;

+ 47
- 3
src/components/user/updateProfileInfo.vue View File

105
           <div class="validation"></div>
105
           <div class="validation"></div>
106
         </div>
106
         </div>
107
       </div>
107
       </div>
108
+
108
       <div v-if="!isAgent()" class="row mb-2">
109
       <div v-if="!isAgent()" class="row mb-2">
109
         <div class="form-group col-md-6">
110
         <div class="form-group col-md-6">
110
           <div class="input-group">
111
           <div class="input-group">
422
 import addressAutoComplete from "../shared/addressAutoComplete";
423
 import addressAutoComplete from "../shared/addressAutoComplete";
423
 import Log from "../../assets/Log";
424
 import Log from "../../assets/Log";
424
 import Alert from "../shared/alert";
425
 import Alert from "../shared/alert";
426
+import logOutVue from "./logOut.vue";
425
 
427
 
426
 export default {
428
 export default {
427
   name: "UpdateInfo",
429
   name: "UpdateInfo",
459
         }
461
         }
460
       } else {
462
       } else {
461
         this.individual = this.indiv;
463
         this.individual = this.indiv;
464
+        this.individual.telephone = this.indiv.landlineNumber;
465
+        this.individual.email = this.indiv.emailAddress;
466
+        console.log(this.indiv);
462
         this.individual.user = Log.getUser();
467
         this.individual.user = Log.getUser();
463
       }
468
       }
464
       this.getAgencies();
469
       this.getAgencies();
527
     sendToApi() {
532
     sendToApi() {
528
       this.boolError = false;
533
       this.boolError = false;
529
       this.individual.emailAddress = this.individual.email;
534
       this.individual.emailAddress = this.individual.email;
530
-
531
       if (this.individual.telephone !== "") {
535
       if (this.individual.telephone !== "") {
532
         if (this.individual.telephone !== null) {
536
         if (this.individual.telephone !== null) {
533
           if (!this.validPhoneNumber(this.individual.telephone)) {
537
           if (!this.validPhoneNumber(this.individual.telephone)) {
583
           this.saveAgent(this.individual)
587
           this.saveAgent(this.individual)
584
             .then(() => {
588
             .then(() => {
585
               if (Log.getUser().role === "Super Admin") {
589
               if (Log.getUser().role === "Super Admin") {
590
+                // console.log(this.individual);
591
+                // console.log(JSON.parse(localStorage.getItem("person")));
592
+                if (this.individual.id === JSON.parse(localStorage.getItem("person"))) {
593
+                  var newPerson = {
594
+                    id: JSON.parse(localStorage.getItem("person")).id,
595
+                    email: this.individual.email,
596
+                    fullname: this.individual.name + " " + this.individual.surname,
597
+                    name: this.individual.name,
598
+                    surname: this.individual.surname
599
+                  };
600
+                  this.$router.go();
601
+                  localStorage.setItem("person", JSON.stringify(newPerson));
602
+                }
586
                 this.$router.push("/status/userManagementPage");
603
                 this.$router.push("/status/userManagementPage");
587
               } else {
604
               } else {
588
-                this.$router.push("/");
605
+                var newPerson = {
606
+                  id: JSON.parse(localStorage.getItem("person")).id,
607
+                  email: this.individual.email,
608
+                  fullname: this.individual.name + " " + this.individual.surname,
609
+                  name: this.individual.name,
610
+                  surname: this.individual.surname
611
+                };
612
+                localStorage.setItem("person", JSON.stringify(newPerson));
613
+                this.$router.go();
589
               }
614
               }
590
             })
615
             })
591
             .catch(ex => {
616
             .catch(ex => {
596
         } else {
621
         } else {
597
           this.updateIndividual(this.individual).then(() => {
622
           this.updateIndividual(this.individual).then(() => {
598
             if (Log.getUser().role === "Super Admin") {
623
             if (Log.getUser().role === "Super Admin") {
624
+              if (this.individual.id === JSON.parse(localStorage.getItem("person")).id) {
625
+                var newPerson = {
626
+                  id: JSON.parse(localStorage.getItem("person")).id,
627
+                  email: this.individual.email,
628
+                  fullname: this.individual.name + " " + this.individual.surname,
629
+                  name: this.individual.name,
630
+                  surname: this.individual.surname
631
+                };
632
+                this.$router.go();
633
+                localStorage.setItem("person", JSON.stringify(newPerson));
634
+              }
599
               this.$router.push("/status/userManagementPage");
635
               this.$router.push("/status/userManagementPage");
600
             } else {
636
             } else {
601
-              this.$router.push("/");
637
+              var newPerson = {
638
+                id: JSON.parse(localStorage.getItem("person")).id,
639
+                email: this.individual.email,
640
+                fullname: this.individual.name + " " + this.individual.surname,
641
+                name: this.individual.name,
642
+                surname: this.individual.surname
643
+              };
644
+              localStorage.setItem("person", JSON.stringify(newPerson));
645
+              this.$router.go();
602
             }
646
             }
603
           });
647
           });
604
         }
648
         }

+ 2
- 2
src/main.js View File

33
 });
33
 });
34
 Vue.config.productionTip = false;
34
 Vue.config.productionTip = false;
35
 //axios.defaults.baseURL = "http://localhost:57260";
35
 //axios.defaults.baseURL = "http://localhost:57260";
36
-axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
37
-//axios.defaults.baseURL = "http://training.provision-sa.com:82/";
36
+//axios.defaults.baseURL = "https://www.pvsl.co.za:86/";
37
+axios.defaults.baseURL = "http://training.provision-sa.com:82/";
38
 //axios.defaults.baseURL = "http://localhost:8080/";
38
 //axios.defaults.baseURL = "http://localhost:8080/";
39
 
39
 
40
 Vue.prototype.$axios = axios;
40
 Vue.prototype.$axios = axios;

+ 9
- 8
src/store/modules/user/authentication.js View File

66
       });
66
       });
67
     },
67
     },
68
     async login({ commit }, user) {
68
     async login({ commit }, user) {
69
-      const response = await axios({
69
+      await axios({
70
         url: "/api/register/authenticate",
70
         url: "/api/register/authenticate",
71
         data: {
71
         data: {
72
           username: user.username,
72
           username: user.username,
73
           password: user.password
73
           password: user.password
74
         },
74
         },
75
         method: "POST"
75
         method: "POST"
76
-      });
77
-      if (response.status === 200) {
76
+      }).then((resp) => {
78
         log.clearValues();
77
         log.clearValues();
79
-        log.setValues(response.data);
80
-        commit("auth_success", response.data);
78
+        log.setValues(resp.data);
79
+        commit("auth_success", resp.data);
81
         return Promise.resolve();
80
         return Promise.resolve();
82
-      } else {
81
+      })
82
+      .catch((ex) => {        
83
         commit("auth_error");
83
         commit("auth_error");
84
         log.clearValues();
84
         log.clearValues();
85
         commit("auth_error", "error occurred");
85
         commit("auth_error", "error occurred");
86
-        return Promise.reject();
87
-      }
86
+        return Promise.reject(ex.response);
87
+      })
88
+      
88
     },
89
     },
89
     logout({ commit }) {
90
     logout({ commit }) {
90
       return new Promise(() => {
91
       return new Promise(() => {

+ 15
- 7
src/store/modules/user/register.js View File

107
   getters: {},
107
   getters: {},
108
   actions: {
108
   actions: {
109
     async forgotPasswordCheck({commit}, mail){
109
     async forgotPasswordCheck({commit}, mail){
110
-      const response = await axios.post('api/register/forgotPassword/'+ mail)
111
-      if(response.status === 200){
112
-        return Promise.resolve()
113
-      }else{
114
-        return Promise.reject()
115
-      }
110
+      await axios.post('api/register/forgotPassword/'+ mail).then((resp) => {
111
+        return Promise.resolve(resp.data)
112
+      })
113
+      .catch((ex) => {
114
+        console.log(ex.response);
115
+        return Promise.reject(ex.response)
116
+      })
117
+      // if(response.status === 200){
118
+      //   return Promise.resolve()
119
+      // }else{
120
+      //   console.log(response.response);
121
+      //   return Promise.reject()
122
+      // }
116
     },
123
     },
117
     getIndividuals({ commit }) {
124
     getIndividuals({ commit }) {
118
       axios
125
       axios
155
           return promise.resolve()
162
           return promise.resolve()
156
         })
163
         })
157
         .catch((ex) => {
164
         .catch((ex) => {
158
-          return promise.reject(ex)
165
+          console.log(ex.response);
166
+          return promise.reject(ex.response)
159
           //console.error;
167
           //console.error;
160
         });
168
         });
161
     },
169
     },

+ 2
- 2
vue.config.js View File

3
     proxy: {
3
     proxy: {
4
       "/api": {
4
       "/api": {
5
         //target: "http://localhost:57260/",
5
         //target: "http://localhost:57260/",
6
-        //target: "http://training.provision-sa.com:82/",
7
-        target: "https://www.pvsl.co.za:86/",
6
+        target: "http://training.provision-sa.com:82/",
7
+        //target: "https://www.pvsl.co.za:86/",
8
         changeOrigin: true
8
         changeOrigin: true
9
       },
9
       },
10
       "/nph-srep": {
10
       "/nph-srep": {

Loading…
Cancel
Save