Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const useOpportunityAcceptanceHandlers = ({
onSaveAnswers,
onLogAnswer,
onLogExperienceLevel,
onComplete,
initialExperienceLevel,
initialLocationId,
}: {
Expand All @@ -37,6 +38,7 @@ export const useOpportunityAcceptanceHandlers = ({
onLogExperienceLevel?: (
experienceLevel: keyof typeof UserExperienceLevel,
) => void;
onComplete?: () => void;
initialExperienceLevel?: keyof typeof UserExperienceLevel;
initialLocationId?: string;
}) => {
Expand Down Expand Up @@ -83,6 +85,7 @@ export const useOpportunityAcceptanceHandlers = ({
case AcceptStep.CV:
if (questions.length > 0) {
goToLastQuestion();
setCurrentStep(AcceptStep.QUESTIONS);
} else {
setCurrentStep(AcceptStep.EXPERIENCE_LEVEL);
}
Expand Down Expand Up @@ -130,6 +133,9 @@ export const useOpportunityAcceptanceHandlers = ({
setCurrentStep(AcceptStep.QUESTIONS);
} else if (!hasUploadedCV) {
setCurrentStep(AcceptStep.CV);
} else {
// Experience level is the last step, complete the flow
onComplete?.();
}
},
});
Expand All @@ -140,6 +146,7 @@ export const useOpportunityAcceptanceHandlers = ({
questions.length,
hasUploadedCV,
setCurrentStep,
onComplete,
]);

const handleNext = useCallback(() => {
Expand Down
1 change: 1 addition & 0 deletions packages/webapp/pages/jobs/[id]/questions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ const AcceptPage = (): ReactElement => {
}),
});
},
onComplete: acceptOpportunity,
initialExperienceLevel: user?.experienceLevel,
initialLocationId: candidatePreferences?.externalLocationId,
});
Expand Down