Ignore:
Timestamp:
02/10/21 22:31:53 (4 years ago)
Author:
Mile Jankuloski <mile.jankuloski@…>
Branches:
master
Children:
6e6f04b
Parents:
e0cdea2
Message:

Minor logging fixes

File:
1 edited

Legend:

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

    re0cdea2 rdae4cde  
    6060            .subscribe((req) => {
    6161              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");
    6663              }
    6764            },
     
    7875            .subscribe((req) => {
    7976              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");
    8478              }
    8579            },
     
    9892  saveDeletedMedicines() {
    9993    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");
    10396          this.editedMedicine = false;
    104         }
    105         else {
    106           this.openSnackBar("Unable to delete Medicine", "Try again");
    107         }
    10897      },
    109       (err: any) => console.log(err),
     98      (err: any) => {
     99        console.log(err);
     100        this.openSnackBar("Failed!", "Try again");
     101      },
    110102      () => console.log('Update sent!'));
    111103  }
     
    132124          this.editedMedicine = true;
    133125        }
    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");
    138127      }
    139128    }, () => this.openSnackBar("Failed! Please try again", "OK"));
     
    160149          this.editedMedicine = true;
    161150        }
    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");
    166152      }
    167153    }, () => this.openSnackBar("Failed! Please try again", "OK"));
     
    215201        this.head.Pharmacy.push(editedPharmacy);
    216202        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(() => {
    220205                  window.location.reload();
    221206                });
    222               }
    223               else {
    224                 this.openSnackBar("Pharmacy edit failed", "Try again");
    225               }
    226207            },
    227208            (err: any) => console.log(err),
Note: See TracChangeset for help on using the changeset viewer.