- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts
rdae4cde re0cdea2 60 60 .subscribe((req) => { 61 61 if(req) { 62 this.openSnackBar("Request sent!", "OK"); 62 this.openSnackBar("Claiming request sent!", "OK"); 63 } 64 else { 65 this.openSnackBar("Unable to send a request", "Try again"); 63 66 } 64 67 }, … … 75 78 .subscribe((req) => { 76 79 if(req) { 77 this.openSnackBar("Request sent!", "OK"); 80 this.openSnackBar("Claiming request sent!", "OK"); 81 } 82 else { 83 this.openSnackBar("Unable to send a request", "Try again"); 78 84 } 79 85 }, … … 92 98 saveDeletedMedicines() { 93 99 this.dataService.updatePharmacyHead(this.head) 94 .subscribe(() => { 95 this.openSnackBar("Success!", "OK"); 100 .subscribe((hd) => { 101 if(hd) { 102 this.openSnackBar("Success! Medicine deleted", "OK"); 96 103 this.editedMedicine = false; 104 } 105 else { 106 this.openSnackBar("Unable to delete Medicine", "Try again"); 107 } 97 108 }, 98 (err: any) => { 99 console.log(err); 100 this.openSnackBar("Failed!", "Try again"); 101 }, 109 (err: any) => console.log(err), 102 110 () => console.log('Update sent!')); 103 111 } … … 124 132 this.editedMedicine = true; 125 133 } 126 this.openSnackBar("Success!", "OK"); 134 this.openSnackBar("Success! Medicine added, please save changes now", "OK"); 135 } 136 else { 137 this.openSnackBar("Failed! Please try again", "OK"); 127 138 } 128 139 }, () => this.openSnackBar("Failed! Please try again", "OK")); … … 149 160 this.editedMedicine = true; 150 161 } 151 this.openSnackBar("Success!", "OK"); 162 this.openSnackBar("Success! Medicines added, please save changes now", "OK"); 163 } 164 else { 165 this.openSnackBar("Failed! Please try again", "OK"); 152 166 } 153 167 }, () => this.openSnackBar("Failed! Please try again", "OK")); … … 201 215 this.head.Pharmacy.push(editedPharmacy); 202 216 this.dataService.updatePharmacyHead(this.head) 203 .subscribe((hd) => { 204 this.openSnackBar("Success!", "OK").onAction().subscribe(() => { 217 .subscribe((hd: IPharmacyHead) => { 218 if(hd) { 219 this.openSnackBar("Success! Pharmacy edited", "OK").onAction().subscribe(() => { 205 220 window.location.reload(); 206 221 }); 222 } 223 else { 224 this.openSnackBar("Pharmacy edit failed", "Try again"); 225 } 207 226 }, 208 227 (err: any) => console.log(err),
Note:
See TracChangeset
for help on using the changeset viewer.