async savePet()

in ui-angular/src/app/app.component.ts [105:119]


  async savePet() {

    const pet = this.model.selectedPet;

    if (!pet) {
      this.model.errorMessage = 'Pet is needed';
      return;
    }
    try {
      await this.apiService.savePet(pet);
      await this.loadAllPets();
    } catch (e) {
      this.model.errorMessage = 'Failed to save pet. ' + e.message;
    }
  }