Compare commits
2 commits
5ef578b3e1
...
aef86419d7
Author | SHA1 | Date | |
---|---|---|---|
aef86419d7 | |||
8c96de6341 |
4 changed files with 9 additions and 1 deletions
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
|
@ -36,7 +36,7 @@
|
|||
"karma-jasmine": "~5.1.0",
|
||||
"karma-jasmine-html-reporter": "~2.1.0",
|
||||
"postcss": "^8.4.41",
|
||||
"tailwindcss": "^3.4.10",
|
||||
"tailwindcss": "^4.0.0",
|
||||
"typescript": "~5.5.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,4 +6,6 @@ export interface Hotel {
|
|||
imageUrl: string;
|
||||
rating: number;
|
||||
tags: Array<string>;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
}
|
||||
|
|
|
@ -127,6 +127,12 @@ export class NewHotelComponent {
|
|||
rating: this.hotelForm.get('rating')?.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.router.navigate(['/']);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue