Compare commits
2 commits
df01d8ae7a
...
6199db698a
Author | SHA1 | Date | |
---|---|---|---|
6199db698a | |||
8c96de6341 |
5 changed files with 15 additions and 7 deletions
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
12
package-lock.json
generated
12
package-lock.json
generated
|
@ -16,7 +16,7 @@
|
|||
"@angular/platform-browser": "^19.0.0",
|
||||
"@angular/platform-browser-dynamic": "^19.0.0",
|
||||
"@angular/router": "^19.0.0",
|
||||
"angular-in-memory-web-api": "^0.18.0",
|
||||
"angular-in-memory-web-api": "^0.19.0",
|
||||
"rxjs": "~7.8.0",
|
||||
"tslib": "^2.3.0",
|
||||
"zone.js": "~0.15.0"
|
||||
|
@ -5761,16 +5761,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/angular-in-memory-web-api": {
|
||||
"version": "0.18.0",
|
||||
"resolved": "https://registry.npmjs.org/angular-in-memory-web-api/-/angular-in-memory-web-api-0.18.0.tgz",
|
||||
"integrity": "sha512-Eqkr9+x3d7K4dmn6Qs3ZVAfqBDPZN0N7Qel5i8eU/pe5r44J/pfxlNW+1LC2Sb2PdENEdvFzC8wx8qly5+kQyQ==",
|
||||
"version": "0.19.0",
|
||||
"resolved": "https://registry.npmjs.org/angular-in-memory-web-api/-/angular-in-memory-web-api-0.19.0.tgz",
|
||||
"integrity": "sha512-o3N46wjUjqVwfJ+14tHc1K5lpSF9RA/6HqR46Mh/K6bFnYgaPiI/qcPkFLxPvTYP8uQQywVmD76q3n6kNBldzA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/common": "^18.0.0",
|
||||
"@angular/core": "^18.0.0",
|
||||
"@angular/common": "^19.0.0",
|
||||
"@angular/core": "^19.0.0",
|
||||
"rxjs": "^6.5.3 || ^7.4.0"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
"@angular/platform-browser": "^19.0.0",
|
||||
"@angular/platform-browser-dynamic": "^19.0.0",
|
||||
"@angular/router": "^19.0.0",
|
||||
"angular-in-memory-web-api": "^0.18.0",
|
||||
"angular-in-memory-web-api": "^0.19.0",
|
||||
"rxjs": "~7.8.0",
|
||||
"tslib": "^2.3.0",
|
||||
"zone.js": "~0.15.0"
|
||||
|
|
|
@ -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