Compare commits
1 commit
aef86419d7
...
5ef578b3e1
Author | SHA1 | Date | |
---|---|---|---|
5ef578b3e1 |
2 changed files with 0 additions and 8 deletions
|
@ -6,6 +6,4 @@ export interface Hotel {
|
||||||
imageUrl: string;
|
imageUrl: string;
|
||||||
rating: number;
|
rating: number;
|
||||||
tags: Array<string>;
|
tags: Array<string>;
|
||||||
email?: string;
|
|
||||||
phone?: string;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,12 +127,6 @@ 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(['/']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue