Start integrating the onboarding flow with backend 14
This commit is contained in:
@@ -34,11 +34,22 @@ export class OnboardingService {
|
||||
): Promise<UserProgress> {
|
||||
// Backend uses current user from auth token, so userId parameter is ignored
|
||||
// Backend expects UpdateStepRequest format for completion
|
||||
return apiClient.put<UserProgress>(`${this.baseUrl}/step`, {
|
||||
const requestBody = {
|
||||
step_name: stepName,
|
||||
completed: true,
|
||||
data: data,
|
||||
});
|
||||
};
|
||||
|
||||
console.log(`🔄 API call to mark step "${stepName}" as completed:`, requestBody);
|
||||
|
||||
try {
|
||||
const response = await apiClient.put<UserProgress>(`${this.baseUrl}/step`, requestBody);
|
||||
console.log(`✅ Step "${stepName}" marked as completed successfully:`, response);
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.error(`❌ API error marking step "${stepName}" as completed:`, error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async resetProgress(userId: string): Promise<UserProgress> {
|
||||
|
||||
Reference in New Issue
Block a user