Compare commits

...

2 commits

Author SHA1 Message Date
5d83c35b9b chore(deps): update devdependencies (non-major)
Some checks failed
renovate/artifacts Artifact file update failure
2025-01-28 09:02:50 +00:00
8c96de6341
feat: add optional email and phone fields to hotel model 2025-01-28 09:21:27 +01:00
4 changed files with 10 additions and 2 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -29,7 +29,7 @@
"@angular/compiler-cli": "^19.0.0",
"@types/jasmine": "~5.1.0",
"autoprefixer": "^10.4.20",
"jasmine-core": "~5.1.0",
"jasmine-core": "~5.5.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
@ -37,6 +37,6 @@
"karma-jasmine-html-reporter": "~2.1.0",
"postcss": "^8.4.41",
"tailwindcss": "^3.4.10",
"typescript": "~5.5.2"
"typescript": "~5.7.0"
}
}

View file

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

View file

@ -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(['/']);
}