Compare commits

..

2 commits

Author SHA1 Message Date
aef86419d7 chore(deps): update dependency tailwindcss to v4
Some checks failed
renovate/artifacts Artifact file update failure
2025-01-28 09:03:16 +00:00
8c96de6341
feat: add optional email and phone fields to hotel model 2025-01-28 09:21:27 +01:00
2 changed files with 8 additions and 0 deletions

View file

@ -6,4 +6,6 @@ export interface Hotel {
imageUrl: string; imageUrl: string;
rating: number; rating: number;
tags: Array<string>; tags: Array<string>;
email?: string;
phone?: string;
} }

View file

@ -127,6 +127,12 @@ export class NewHotelComponent {
rating: this.hotelForm.get('rating')?.value, rating: this.hotelForm.get('rating')?.value,
tags: this.hotelForm.get('tags')?.value, tags: this.hotelForm.get('tags')?.value,
}; };
if (this.hotelForm.get('contactType')?.value == 'Email') {
hotel.email = this.hotelForm.get('email')?.value;
} else {
hotel.phone = this.hotelForm.get('phone')?.value;
}
this.http.post('/api/hotels/', hotel).subscribe(); this.http.post('/api/hotels/', hotel).subscribe();
this.router.navigate(['/']); this.router.navigate(['/']);
} }