refactor(onboarding): restructure onboarding routes and components
- Removed obsolete onboarding routes: complete, create-complex, index, verify-email, and verify. - Introduced new setup stepper page for onboarding process. - Created a multi-step setup component to handle complex creation with validation. - Added new schemas for complex creation and plan features. - Implemented detailed steps for complex name, location, plan selection, and court setup. - Enhanced error handling and user feedback during the onboarding process.
This commit is contained in:
@@ -43,7 +43,6 @@ export class ApiClientError extends Error {
|
||||
}
|
||||
|
||||
export const apiClient = {
|
||||
onboarding: api.onboarding,
|
||||
plans: api.plans,
|
||||
user: api.user,
|
||||
complexes: api.complexes,
|
||||
|
||||
@@ -6,7 +6,6 @@ export * as courts from './resources/courts';
|
||||
export * as user from './resources/user';
|
||||
export * as sports from './resources/sports';
|
||||
export * as plans from './resources/plans';
|
||||
export * as onboarding from './resources/onboarding';
|
||||
|
||||
export {
|
||||
getAvailability,
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
import type {
|
||||
OnboardingCompleteInput,
|
||||
OnboardingCompleteResponse,
|
||||
OnboardingResendOtpInput,
|
||||
OnboardingResendOtpResponse,
|
||||
OnboardingStartInput,
|
||||
OnboardingStartResponse,
|
||||
OnboardingVerifyOtpInput,
|
||||
OnboardingVerifyOtpResponse,
|
||||
} from '@repo/api-contract';
|
||||
import { http } from '../http';
|
||||
|
||||
export async function start(payload: OnboardingStartInput) {
|
||||
const response = await http.post<OnboardingStartResponse>('/api/onboarding/start', payload);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function verifyOtp(payload: OnboardingVerifyOtpInput) {
|
||||
const response = await http.post<OnboardingVerifyOtpResponse>(
|
||||
'/api/onboarding/verify-otp',
|
||||
payload
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function resendOtp(payload: OnboardingResendOtpInput) {
|
||||
const response = await http.post<OnboardingResendOtpResponse>(
|
||||
'/api/onboarding/resend-otp',
|
||||
payload
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function complete(payload: OnboardingCompleteInput) {
|
||||
const response = await http.post<OnboardingCompleteResponse>('/api/onboarding/complete', payload);
|
||||
return response.data;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { PlanSummary } from '@repo/api-contract';
|
||||
import type { PlanWithFeatures } from '@repo/api-contract';
|
||||
import { http } from '../http';
|
||||
|
||||
export async function list() {
|
||||
const response = await http.get<PlanSummary[]>('/api/plans');
|
||||
const response = await http.get<PlanWithFeatures[]>('/api/plans');
|
||||
return response.data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user