Changes in / [6e6f04b:8eb1e21]
- Location:
- Farmatiko/ClientApp/src/app
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/admin/admin.component.html
r6e6f04b r8eb1e21 56 56 <tr *ngFor="let head of heads"> 57 57 <td><a (click)="openPharmacyHeadDialog(head)">{{head.Name}}</a> | {{head.Email}}</td> 58 <td><a (click)="deletePharmacyHead(head)" *ngIf="head.Name !== 'Admin'">Delete</a><span *ngIf="head.Name == 'Admin'">Can't delete Admin</span> | <a (click)="openEditPharmacyHeadDialog(head)">Change</a></td>58 <td><a (click)="deletePharmacyHead(head)">Delete</a> | <a (click)="openEditPharmacyHeadDialog(head)">Change</a></td> 59 59 </tr> 60 60 </tbody> -
Farmatiko/ClientApp/src/app/admin/admin.component.ts
r6e6f04b r8eb1e21 56 56 createHead() { 57 57 this.dataService.insertPharmacyHead(this.head) 58 .subscribe((cHead) => { 58 .subscribe((cHead: IPharmacyHead) => { 59 if(cHead) { 59 60 this.heads.push(cHead); 60 61 this.openSnackBar("New head created!","OK"); 62 } 61 63 }, 62 64 (err: any) => console.log(err), … … 77 79 }, 78 80 (err: any) => console.log(err), 79 () => { 80 console.log("PharmacyHead deleted"); 81 location.reload(); 82 }); 81 () => console.log("PharmacyHead deleted")); 83 82 } 84 83 … … 89 88 }); 90 89 dialogRef.afterClosed().subscribe((editedHead: IPharmacyHead) => { 91 if(editedHead) { 92 console.log(editedHead); 93 this.heads = this.heads.filter(x => x !== eHead); 94 this.heads.push(editedHead); 95 this.dataService.updatePharmacyHead(editedHead) 96 .subscribe((hd: IPharmacyHead) => { 97 this.openSnackBar("Success! PharmacyHead edited", "OK").onAction().subscribe(() => { 98 location.reload(); 99 }); 100 }, 101 (err: any) => console.log(err), 102 () => console.log('PharmacyHead data updated')); 90 if(editedHead){ 91 console.log(editedHead); 92 this.heads = this.heads.filter(x => x !== eHead); 93 this.heads.push(editedHead); 94 this.dataService.updatePharmacyHead(editedHead) 95 .subscribe((hd: IPharmacyHead) => { 96 if(hd) { 97 this.openSnackBar("Success! PharmacyHead edited", "OK").onAction().subscribe(() => { 98 window.location.reload(); 99 }); 100 } 101 else { 102 this.openSnackBar("PharmacyHead edit failed", "Try again"); 103 } 104 }, 105 (err: any) => console.log(err), 106 () => console.log('PharmacyHead data updated')); 103 107 } 104 108 }); … … 123 127 .subscribe((status: boolean) => { 124 128 if(status) { 125 this.openSnackBar("Request processed!","OK"); 129 this.openSnackBar("Request rejected!","OK"); 130 } 131 else { 132 this.openSnackBar("Something went wrong","Try again"); 126 133 } 127 134 }, 128 135 (err: any) => console.log(err), 129 () => { 130 console.log("PharmacyHeadRequest deleted"); 131 location.reload(); 132 }); 136 () => console.log("PharmacyHeadRequest deleted")); 133 137 } 134 138 … … 144 148 }, 145 149 (err: any) => console.log(err), 146 () => { 147 console.log("PharmacyHead updated"); 148 location.reload(); 149 }) 150 () => console.log("PharmacyHead updated")) 150 151 } 151 152 } -
Farmatiko/ClientApp/src/app/counter/counter.component.ts
r6e6f04b r8eb1e21 83 83 } 84 84 facils.forEach((facil) => { 85 this.http.get<any>('https:// jankuloski.xyz:8080/https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+facil.municipality+'&street='+facil.address+'&format=json').subscribe(obj => {85 this.http.get<any>('https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+facil.municipality+'&street='+facil.address+'&format=json').subscribe(obj => { 86 86 console.log(obj); 87 87 if(obj.length) { -
Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts
r6e6f04b r8eb1e21 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), -
Farmatiko/ClientApp/src/app/dialogs/facility-dialog/facility-dialog.component.ts
r6e6f04b r8eb1e21 32 32 33 33 addMarkers() { 34 this.http.get<any>('https:// jankuloski.xyz:8080/https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+this.facility?.municipality+'&street='+this.facility?.address+'&format=json').subscribe(obj => {34 this.http.get<any>('https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+this.facility?.municipality+'&street='+this.facility?.address+'&format=json').subscribe(obj => { 35 35 console.log(obj); 36 36 if(obj.length) { -
Farmatiko/ClientApp/src/app/dialogs/pharmacy-dialog/pharmacy-dialog.component.ts
r6e6f04b r8eb1e21 32 32 33 33 addMarkers() { 34 this.http.get<any>('https:// jankuloski.xyz:8080/https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+this.pharmacy?.location+'&street='+this.pharmacy?.address+'&format=json').subscribe(obj => {34 this.http.get<any>('https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+this.pharmacy?.location+'&street='+this.pharmacy?.address+'&format=json').subscribe(obj => { 35 35 console.log(obj); 36 36 if(obj.length) { -
Farmatiko/ClientApp/src/app/home/home.component.ts
r6e6f04b r8eb1e21 82 82 } 83 83 pharmas.forEach((pharmacy) => { 84 this.http.get<any>('https:// jankuloski.xyz:8080/https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+pharmacy.location+'&street='+pharmacy.address+'&format=json').subscribe(obj => {84 this.http.get<any>('https://nominatim.openstreetmap.org/search/?country=Macedonia&city='+pharmacy.location+'&street='+pharmacy.address+'&format=json').subscribe(obj => { 85 85 console.log(obj); 86 86 if(obj.length) { -
Farmatiko/ClientApp/src/app/shared/interfaces.ts
r6e6f04b r8eb1e21 64 64 PharmacyHead?: IPharmacyHead; 65 65 Pharmacy?: IPharmacy; 66 } 66 }
Note:
See TracChangeset
for help on using the changeset viewer.