fix: design
This commit is contained in:
@@ -3,7 +3,7 @@ import { useMutation, useQuery } from '@tanstack/vue-query'
|
||||
import {
|
||||
apiCompleteProfile,
|
||||
apiForgotPassword,
|
||||
apiGetProfile,
|
||||
apiGetMe,
|
||||
apiGetRegistrationQuestionVideo,
|
||||
apiLogin,
|
||||
apiLoginWithCode,
|
||||
@@ -12,13 +12,13 @@ import {
|
||||
apiResendVerificationCode,
|
||||
apiResetPassword,
|
||||
apiUpdateProfile,
|
||||
apiUploadTemporary,
|
||||
apiUploadMedia,
|
||||
apiVerifyCode,
|
||||
apiVerifyForgotPasswordCode,
|
||||
} from '@/services/api/auth'
|
||||
|
||||
export const authKeys = {
|
||||
profile: () => ['auth', 'profile'],
|
||||
me: () => ['auth', 'me'],
|
||||
registrationVideo: () => ['auth', 'registration-video'],
|
||||
}
|
||||
|
||||
@@ -42,10 +42,10 @@ export const useResetPasswordMutation = () => useMutation({ mutationFn: apiReset
|
||||
|
||||
export const useLogoutMutation = () => useMutation({ mutationFn: apiLogout })
|
||||
|
||||
export const useGetProfileQuery = (options = {}) =>
|
||||
export const useGetMeQuery = (options = {}) =>
|
||||
useQuery({
|
||||
queryKey: authKeys.profile(),
|
||||
queryFn: () => apiGetProfile(),
|
||||
queryKey: authKeys.me(),
|
||||
queryFn: () => apiGetMe(),
|
||||
select: (response) => response?.data?.user ?? response?.data ?? response,
|
||||
...options,
|
||||
})
|
||||
@@ -62,4 +62,4 @@ export const useGetRegistrationVideoQuery = (options = {}) =>
|
||||
...options,
|
||||
})
|
||||
|
||||
export const useUploadTemporaryMutation = () => useMutation({ mutationFn: apiUploadTemporary })
|
||||
export const useUploadMediaMutation = () => useMutation({ mutationFn: apiUploadMedia })
|
||||
|
||||
Reference in New Issue
Block a user