generated from bisco/codex-bootstrap
feat(frontend): add performance booking form
This commit is contained in:
@@ -30,6 +30,20 @@ export type ShowDetail = ShowListItem & {
|
||||
performances?: ShowPerformance[];
|
||||
};
|
||||
|
||||
export type ReservationCreatePayload = {
|
||||
name: string;
|
||||
email: string;
|
||||
party_size: number;
|
||||
};
|
||||
|
||||
export type ReservationCreateResponse = {
|
||||
id: number;
|
||||
status: string;
|
||||
performance: number;
|
||||
party_size: number;
|
||||
message: string;
|
||||
};
|
||||
|
||||
type ShowListResponse = {
|
||||
results: ShowListItem[];
|
||||
};
|
||||
@@ -58,4 +72,11 @@ export class ShowsApiService {
|
||||
params: { show: slug },
|
||||
});
|
||||
}
|
||||
|
||||
createReservation(performanceId: string, payload: ReservationCreatePayload): Observable<ReservationCreateResponse> {
|
||||
return this.http.post<ReservationCreateResponse>(
|
||||
`${this.apiBaseUrl}/performances/${performanceId}/reservations/`,
|
||||
payload,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user