feat: implement complex selection flow

This commit is contained in:
Jose Selesan
2026-04-20 15:47:47 -03:00
parent a5e39c94c5
commit 28fd51f926
17 changed files with 453 additions and 38 deletions

View File

@@ -1,6 +1,7 @@
import type {
AdminBooking,
Complex,
ComplexWithRole,
Court,
CreateAdminBookingInput,
CreateComplexPayload,
@@ -20,6 +21,7 @@ import type {
PublicAvailabilityResponse,
PublicBooking,
PublicBookingConfirmation,
SelectComplexInput,
Sport,
UpdateAdminBookingStatusInput,
UpdateComplexPayload,
@@ -187,7 +189,17 @@ export const apiClient = {
return response.data;
},
listMine: async () => {
const response = await http.get<Complex[]>('/api/complexes/mine');
const response = await http.get<ComplexWithRole[]>('/api/complexes/mine');
return response.data;
},
getCurrent: async () => {
const response = await http.get<ComplexWithRole | null>('/api/complexes/me');
return response.data;
},
select: async (payload: SelectComplexInput) => {
const response = await http.post<ComplexWithRole>('/api/complexes/select', JSON.stringify(payload), {
headers: { 'Content-Type': 'application/json' }
});
return response.data;
},
},