feat: implement onboarding flow with complex creation and email verification, and add Zustand for state management
This commit is contained in:
@@ -31,4 +31,4 @@ export function configureApiClient(nextHandlers: ErrorHandlers) {
|
||||
handlers.onError = nextHandlers.onError;
|
||||
}
|
||||
|
||||
export { handlers };
|
||||
export { handlers };
|
||||
|
||||
@@ -57,4 +57,4 @@ http.interceptors.response.use(
|
||||
|
||||
return Promise.reject(normalized);
|
||||
}
|
||||
);
|
||||
);
|
||||
|
||||
@@ -15,4 +15,4 @@ export {
|
||||
listByComplex,
|
||||
createAdmin,
|
||||
updateStatus,
|
||||
} from './resources/bookings';
|
||||
} from './resources/bookings';
|
||||
|
||||
@@ -57,4 +57,4 @@ export async function updateStatus(bookingId: string, payload: UpdateAdminBookin
|
||||
payload
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@ import type {
|
||||
} from '@repo/api-contract';
|
||||
import { http } from '../http';
|
||||
|
||||
export async function create(payload: CreateComplexPayload) {
|
||||
export async function create(
|
||||
payload: CreateComplexPayload & { adminEmail?: string; userId?: string }
|
||||
) {
|
||||
const response = await http.post<CreateComplexResponse>('/api/complexes', payload);
|
||||
return response.data;
|
||||
}
|
||||
@@ -46,4 +48,4 @@ export async function select(payload: SelectComplexInput) {
|
||||
{ headers: { 'Content-Type': 'application/json' } }
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ export async function create(complexId: string, payload: CreateCourtInput) {
|
||||
export async function update(id: string, payload: UpdateCourtInput) {
|
||||
const response = await http.patch<Court>(`/api/courts/${id}`, payload);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,6 @@ export async function resendOtp(payload: OnboardingResendOtpInput) {
|
||||
}
|
||||
|
||||
export async function complete(payload: OnboardingCompleteInput) {
|
||||
const response = await http.post<OnboardingCompleteResponse>(
|
||||
'/api/onboarding/complete',
|
||||
payload
|
||||
);
|
||||
const response = await http.post<OnboardingCompleteResponse>('/api/onboarding/complete', payload);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@ import { http } from '../http';
|
||||
export async function list() {
|
||||
const response = await http.get<PlanSummary[]>('/api/plans');
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ export async function create(payload: CreateSportInput) {
|
||||
export async function update(id: string, payload: UpdateSportInput) {
|
||||
const response = await http.patch<Sport>(`/api/sports/${id}`, payload);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@ import { http } from '../http';
|
||||
export async function getProfile() {
|
||||
const response = await http.get<UserProfileResponse>('/api/user/profile');
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user