diff --git a/src/app/hotel/component/edit-hotel.component.ts b/src/app/hotel/component/edit-hotel.component.ts index 4a119ce..9f1e6d7 100644 --- a/src/app/hotel/component/edit-hotel.component.ts +++ b/src/app/hotel/component/edit-hotel.component.ts @@ -230,8 +230,11 @@ export class EditHotelComponent implements OnInit { rating: this.form.value.rating, id: this.hotel?.id ?? 0, tags: this.form.value.tags ?? [], - email: this.form.value.email, - phoneNumber: this.form.value.phoneNumber, + email: this.activeContact === 'email' ? this.emailGroup.value.email : '', + phoneNumber: + this.activeContact === 'phoneNumber' + ? this.phoneNumberGroup.value.phoneNumber + : '', }; this.updateHotel.emit(hotel); diff --git a/src/app/hotel/service/HotelData.service.ts b/src/app/hotel/service/HotelData.service.ts index c1fa836..cb3fd14 100644 --- a/src/app/hotel/service/HotelData.service.ts +++ b/src/app/hotel/service/HotelData.service.ts @@ -13,7 +13,7 @@ export class HotelDataService implements InMemoryDbService { rating: 3.5, tags: ['Meer', 'Berge'], email: 'buea@mail.com', - phoneNumber: '1234567890', + phoneNumber: '', }, { id: 2, @@ -24,7 +24,7 @@ export class HotelDataService implements InMemoryDbService { rating: 5, tags: ['Meer', 'Berge'], email: 'marrakesch@mail.com', - phoneNumber: '1234567890', + phoneNumber: '', }, { id: 3, @@ -35,7 +35,7 @@ export class HotelDataService implements InMemoryDbService { rating: 4, tags: ['Meer', 'Berge'], email: 'abuja@mail.com', - phoneNumber: '1234567890', + phoneNumber: '', }, { id: 4, @@ -46,7 +46,7 @@ export class HotelDataService implements InMemoryDbService { rating: 2.5, tags: ['Meer', 'Berge'], email: 'our@mail.com', - phoneNumber: '1234567890', + phoneNumber: '', }, ];