fix: complete registration frontend flow
Deploy banu-front / deploy (push) Successful in 1m40s

This commit is contained in:
Server Migration
2026-08-15 17:28:40 +03:30
parent d94a96b25e
commit b64f528c0d
20 changed files with 431 additions and 158 deletions
+12 -1
View File
@@ -60,10 +60,21 @@ export const useCompleteProfileMutation = () => useMutation({ mutationFn: apiCom
export const useUpdateProfileMutation = () => useMutation({ mutationFn: apiUpdateProfile })
const getRegistrationVideoIfAvailable = async () => {
try {
return await apiGetRegistrationQuestionVideo()
} catch (error) {
// The migrated backend does not expose this optional content endpoint yet.
// Treat a missing route as "no tutorial uploaded" so registration remains usable.
if (error?.response?.status === 404) return {}
throw error
}
}
export const useGetRegistrationVideoQuery = (options = {}) =>
useQuery({
queryKey: authKeys.registrationVideo(),
queryFn: () => apiGetRegistrationQuestionVideo(),
queryFn: getRegistrationVideoIfAvailable,
select: (response) => response?.data ?? response,
...options,
})