Changeset dae4cde
- Timestamp:
- 02/10/21 22:31:53 (4 years ago)
- Branches:
- master
- Children:
- 6e6f04b
- Parents:
- e0cdea2
- Location:
- Farmatiko/ClientApp/src/app
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Farmatiko/ClientApp/src/app/admin/admin.component.html
re0cdea2 rdae4cde 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)" >Delete</a> | <a (click)="openEditPharmacyHeadDialog(head)">Change</a></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> 59 59 </tr> 60 60 </tbody> -
Farmatiko/ClientApp/src/app/admin/admin.component.ts
re0cdea2 rdae4cde 56 56 createHead() { 57 57 this.dataService.insertPharmacyHead(this.head) 58 .subscribe((cHead: IPharmacyHead) => { 59 if(cHead) { 58 .subscribe((cHead) => { 60 59 this.heads.push(cHead); 61 60 this.openSnackBar("New head created!","OK"); 62 }63 61 }, 64 62 (err: any) => console.log(err), … … 79 77 }, 80 78 (err: any) => console.log(err), 81 () => console.log("PharmacyHead deleted")); 79 () => { 80 console.log("PharmacyHead deleted"); 81 location.reload(); 82 }); 82 83 } 83 84 … … 88 89 }); 89 90 dialogRef.afterClosed().subscribe((editedHead: IPharmacyHead) => { 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')); 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')); 107 103 } 108 104 }); … … 127 123 .subscribe((status: boolean) => { 128 124 if(status) { 129 this.openSnackBar("Request rejected!","OK"); 130 } 131 else { 132 this.openSnackBar("Something went wrong","Try again"); 125 this.openSnackBar("Request processed!","OK"); 133 126 } 134 127 }, 135 128 (err: any) => console.log(err), 136 () => console.log("PharmacyHeadRequest deleted")); 129 () => { 130 console.log("PharmacyHeadRequest deleted"); 131 location.reload(); 132 }); 137 133 } 138 134 … … 148 144 }, 149 145 (err: any) => console.log(err), 150 () => console.log("PharmacyHead updated")) 146 () => { 147 console.log("PharmacyHead updated"); 148 location.reload(); 149 }) 151 150 } 152 151 } -
Farmatiko/ClientApp/src/app/counter/counter.component.ts
re0cdea2 rdae4cde 83 83 } 84 84 facils.forEach((facil) => { 85 this.http.get<any>('https:// nominatim.openstreetmap.org/search/?country=Macedonia&city='+facil.municipality+'&street='+facil.address+'&format=json').subscribe(obj => {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 => { 86 86 console.log(obj); 87 87 if(obj.length) { -
Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts
re0cdea2 rdae4cde 60 60 .subscribe((req) => { 61 61 if(req) { 62 this.openSnackBar("Claiming request sent!", "OK"); 63 } 64 else { 65 this.openSnackBar("Unable to send a request", "Try again"); 62 this.openSnackBar("Request sent!", "OK"); 66 63 } 67 64 }, … … 78 75 .subscribe((req) => { 79 76 if(req) { 80 this.openSnackBar("Claiming request sent!", "OK"); 81 } 82 else { 83 this.openSnackBar("Unable to send a request", "Try again"); 77 this.openSnackBar("Request sent!", "OK"); 84 78 } 85 79 }, … … 98 92 saveDeletedMedicines() { 99 93 this.dataService.updatePharmacyHead(this.head) 100 .subscribe((hd) => { 101 if(hd) { 102 this.openSnackBar("Success! Medicine deleted", "OK"); 94 .subscribe(() => { 95 this.openSnackBar("Success!", "OK"); 103 96 this.editedMedicine = false; 104 }105 else {106 this.openSnackBar("Unable to delete Medicine", "Try again");107 }108 97 }, 109 (err: any) => console.log(err), 98 (err: any) => { 99 console.log(err); 100 this.openSnackBar("Failed!", "Try again"); 101 }, 110 102 () => console.log('Update sent!')); 111 103 } … … 132 124 this.editedMedicine = true; 133 125 } 134 this.openSnackBar("Success! Medicine added, please save changes now", "OK"); 135 } 136 else { 137 this.openSnackBar("Failed! Please try again", "OK"); 126 this.openSnackBar("Success!", "OK"); 138 127 } 139 128 }, () => this.openSnackBar("Failed! Please try again", "OK")); … … 160 149 this.editedMedicine = true; 161 150 } 162 this.openSnackBar("Success! Medicines added, please save changes now", "OK"); 163 } 164 else { 165 this.openSnackBar("Failed! Please try again", "OK"); 151 this.openSnackBar("Success!", "OK"); 166 152 } 167 153 }, () => this.openSnackBar("Failed! Please try again", "OK")); … … 215 201 this.head.Pharmacy.push(editedPharmacy); 216 202 this.dataService.updatePharmacyHead(this.head) 217 .subscribe((hd: IPharmacyHead) => { 218 if(hd) { 219 this.openSnackBar("Success! Pharmacy edited", "OK").onAction().subscribe(() => { 203 .subscribe((hd) => { 204 this.openSnackBar("Success!", "OK").onAction().subscribe(() => { 220 205 window.location.reload(); 221 206 }); 222 }223 else {224 this.openSnackBar("Pharmacy edit failed", "Try again");225 }226 207 }, 227 208 (err: any) => console.log(err), -
Farmatiko/ClientApp/src/app/dialogs/facility-dialog/facility-dialog.component.ts
re0cdea2 rdae4cde 32 32 33 33 addMarkers() { 34 this.http.get<any>('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://jankuloski.xyz:8080/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
re0cdea2 rdae4cde 32 32 33 33 addMarkers() { 34 this.http.get<any>('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://jankuloski.xyz:8080/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
re0cdea2 rdae4cde 82 82 } 83 83 pharmas.forEach((pharmacy) => { 84 this.http.get<any>('https:// nominatim.openstreetmap.org/search/?country=Macedonia&city='+pharmacy.location+'&street='+pharmacy.address+'&format=json').subscribe(obj => {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 => { 85 85 console.log(obj); 86 86 if(obj.length) { -
Farmatiko/ClientApp/src/app/shared/interfaces.ts
re0cdea2 rdae4cde 64 64 PharmacyHead?: IPharmacyHead; 65 65 Pharmacy?: IPharmacy; 66 } 66 }
Note:
See TracChangeset
for help on using the changeset viewer.