Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Farmatiko/ClientApp/src/app/dashboard/dashboard.component.ts

    rdae4cde re0cdea2  
    6060            .subscribe((req) => {
    6161              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");
    6366              }
    6467            },
     
    7578            .subscribe((req) => {
    7679              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");
    7884              }
    7985            },
     
    9298  saveDeletedMedicines() {
    9399    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");
    96103          this.editedMedicine = false;
     104        }
     105        else {
     106          this.openSnackBar("Unable to delete Medicine", "Try again");
     107        }
    97108      },
    98       (err: any) => {
    99         console.log(err);
    100         this.openSnackBar("Failed!", "Try again");
    101       },
     109      (err: any) => console.log(err),
    102110      () => console.log('Update sent!'));
    103111  }
     
    124132          this.editedMedicine = true;
    125133        }
    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");
    127138      }
    128139    }, () => this.openSnackBar("Failed! Please try again", "OK"));
     
    149160          this.editedMedicine = true;
    150161        }
    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");
    152166      }
    153167    }, () => this.openSnackBar("Failed! Please try again", "OK"));
     
    201215        this.head.Pharmacy.push(editedPharmacy);
    202216        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(() => {
    205220                  window.location.reload();
    206221                });
     222              }
     223              else {
     224                this.openSnackBar("Pharmacy edit failed", "Try again");
     225              }
    207226            },
    208227            (err: any) => console.log(err),
Note: See TracChangeset for help on using the changeset viewer.