Compare commits
2 commits
cb862363e9
...
5d83c35b9b
Author | SHA1 | Date | |
---|---|---|---|
5d83c35b9b | |||
8c96de6341 |
4 changed files with 10 additions and 2 deletions
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
|
@ -29,7 +29,7 @@
|
||||||
"@angular/compiler-cli": "^19.0.0",
|
"@angular/compiler-cli": "^19.0.0",
|
||||||
"@types/jasmine": "~5.1.0",
|
"@types/jasmine": "~5.1.0",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"jasmine-core": "~5.1.0",
|
"jasmine-core": "~5.5.0",
|
||||||
"karma": "~6.4.0",
|
"karma": "~6.4.0",
|
||||||
"karma-chrome-launcher": "~3.2.0",
|
"karma-chrome-launcher": "~3.2.0",
|
||||||
"karma-coverage": "~2.2.0",
|
"karma-coverage": "~2.2.0",
|
||||||
|
@ -37,6 +37,6 @@
|
||||||
"karma-jasmine-html-reporter": "~2.1.0",
|
"karma-jasmine-html-reporter": "~2.1.0",
|
||||||
"postcss": "^8.4.41",
|
"postcss": "^8.4.41",
|
||||||
"tailwindcss": "^3.4.10",
|
"tailwindcss": "^3.4.10",
|
||||||
"typescript": "~5.5.2"
|
"typescript": "~5.7.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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(['/']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue