This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user