에러 코드 네이밍 변경
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL } from '@/shared/api/urls';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
LoginParams,
|
||||
LoginResponse
|
||||
@@ -17,8 +17,8 @@ export const login = (params: LoginParams) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useLoginMutation = (options?: UseMutationOptions<LoginResponse, CBDCAxiosError, LoginParams>) => {
|
||||
const mutation = useMutation<LoginResponse, CBDCAxiosError, LoginParams>({
|
||||
export const useLoginMutation = (options?: UseMutationOptions<LoginResponse, NiceAxiosError, LoginParams>) => {
|
||||
const mutation = useMutation<LoginResponse, NiceAxiosError, LoginParams>({
|
||||
...options,
|
||||
mutationFn: (params: LoginParams) => login(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ShortcutDefaultParams,
|
||||
ShortcutDefaultResponse
|
||||
@@ -17,8 +17,8 @@ export const shortcutDefault = (params: ShortcutDefaultParams) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useShortcutDefaultMutation = (options?: UseMutationOptions<ShortcutDefaultResponse, CBDCAxiosError, ShortcutDefaultParams>) => {
|
||||
const mutation = useMutation<ShortcutDefaultResponse, CBDCAxiosError, ShortcutDefaultParams>({
|
||||
export const useShortcutDefaultMutation = (options?: UseMutationOptions<ShortcutDefaultResponse, NiceAxiosError, ShortcutDefaultParams>) => {
|
||||
const mutation = useMutation<ShortcutDefaultResponse, NiceAxiosError, ShortcutDefaultParams>({
|
||||
...options,
|
||||
mutationFn: (params: ShortcutDefaultParams) => shortcutDefault(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ShortcutSaveParams,
|
||||
ShortcutSaveResponse
|
||||
@@ -17,8 +17,8 @@ export const shortcutSave = (params: ShortcutSaveParams) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useShortcutSaveMutation = (options?: UseMutationOptions<ShortcutSaveResponse, CBDCAxiosError, ShortcutSaveParams>) => {
|
||||
const mutation = useMutation<ShortcutSaveResponse, CBDCAxiosError, ShortcutSaveParams>({
|
||||
export const useShortcutSaveMutation = (options?: UseMutationOptions<ShortcutSaveResponse, NiceAxiosError, ShortcutSaveParams>) => {
|
||||
const mutation = useMutation<ShortcutSaveResponse, NiceAxiosError, ShortcutSaveParams>({
|
||||
...options,
|
||||
mutationFn: (params: ShortcutSaveParams) => shortcutSave(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ShortcutUserParams,
|
||||
ShortcutUserResponse
|
||||
@@ -17,8 +17,8 @@ export const shortcutUser = (params: ShortcutUserParams) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useShortcutUserMutation = (options?: UseMutationOptions<ShortcutUserResponse, CBDCAxiosError, ShortcutUserParams>) => {
|
||||
const mutation = useMutation<ShortcutUserResponse, CBDCAxiosError, ShortcutUserParams>({
|
||||
export const useShortcutUserMutation = (options?: UseMutationOptions<ShortcutUserResponse, NiceAxiosError, ShortcutUserParams>) => {
|
||||
const mutation = useMutation<ShortcutUserResponse, NiceAxiosError, ShortcutUserParams>({
|
||||
...options,
|
||||
mutationFn: (params: ShortcutUserParams) => shortcutUser(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ChangeCancelPasswordParams,
|
||||
ChangeCancelPasswordResponse
|
||||
@@ -17,8 +17,8 @@ export const userChangeCancelPassword = (params: ChangeCancelPasswordParams) =>
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserChangeCancelPasswordMutation = (options?: UseMutationOptions<ChangeCancelPasswordResponse, CBDCAxiosError, ChangeCancelPasswordParams>) => {
|
||||
const mutation = useMutation<ChangeCancelPasswordResponse, CBDCAxiosError, ChangeCancelPasswordParams>({
|
||||
export const useUserChangeCancelPasswordMutation = (options?: UseMutationOptions<ChangeCancelPasswordResponse, NiceAxiosError, ChangeCancelPasswordParams>) => {
|
||||
const mutation = useMutation<ChangeCancelPasswordResponse, NiceAxiosError, ChangeCancelPasswordParams>({
|
||||
...options,
|
||||
mutationFn: (params: ChangeCancelPasswordParams) => userChangeCancelPassword(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
ChangePasswordParams,
|
||||
ChangePasswordResponse
|
||||
@@ -17,8 +17,8 @@ export const userChangePassword = (params: ChangePasswordParams) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserChangePasswordMutation = (options?: UseMutationOptions<ChangePasswordResponse, CBDCAxiosError, ChangePasswordParams>) => {
|
||||
const mutation = useMutation<ChangePasswordResponse, CBDCAxiosError, ChangePasswordParams>({
|
||||
export const useUserChangePasswordMutation = (options?: UseMutationOptions<ChangePasswordResponse, NiceAxiosError, ChangePasswordParams>) => {
|
||||
const mutation = useMutation<ChangePasswordResponse, NiceAxiosError, ChangePasswordParams>({
|
||||
...options,
|
||||
mutationFn: (params: ChangePasswordParams) => userChangePassword(params),
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserCreateParams,
|
||||
UserCreateResponse
|
||||
@@ -43,8 +43,8 @@ export const userCreate = async (params: UserCreateParams): Promise<UserCreateMu
|
||||
}
|
||||
};
|
||||
|
||||
export const useUserCreateMutation = (options?: UseMutationOptions<UserCreateMutationResponse, CBDCAxiosError, UserCreateParams>) => {
|
||||
const mutation = useMutation<UserCreateMutationResponse, CBDCAxiosError, UserCreateParams>({
|
||||
export const useUserCreateMutation = (options?: UseMutationOptions<UserCreateMutationResponse, NiceAxiosError, UserCreateParams>) => {
|
||||
const mutation = useMutation<UserCreateMutationResponse, NiceAxiosError, UserCreateParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserCreateParams) => userCreate(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserExistsUseridResponse
|
||||
} from '../model/types';
|
||||
@@ -16,8 +16,8 @@ export const userExistsUserid = (usrId: string) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserExistsUseridMutation = (options?: UseMutationOptions<UserExistsUseridResponse, CBDCAxiosError, string>) => {
|
||||
const mutation = useMutation<UserExistsUseridResponse, CBDCAxiosError, string>({
|
||||
export const useUserExistsUseridMutation = (options?: UseMutationOptions<UserExistsUseridResponse, NiceAxiosError, string>) => {
|
||||
const mutation = useMutation<UserExistsUseridResponse, NiceAxiosError, string>({
|
||||
...options,
|
||||
mutationFn: (usrId: string) => userExistsUserid(usrId),
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserExistsUseridResponse
|
||||
} from '../model/types';
|
||||
@@ -16,9 +16,9 @@ export const userExistsUserid = async (usrid: string) => {
|
||||
|
||||
export const useUserExistsUseridQuery = (
|
||||
usrid: string,
|
||||
options?: Omit<UseQueryOptions<UserExistsUseridResponse, CBDCAxiosError>, 'queryKey' | 'queryFn'>
|
||||
options?: Omit<UseQueryOptions<UserExistsUseridResponse, NiceAxiosError>, 'queryKey' | 'queryFn'>
|
||||
) => {
|
||||
const query = useQuery<UserExistsUseridResponse, CBDCAxiosError>({
|
||||
const query = useQuery<UserExistsUseridResponse, NiceAxiosError>({
|
||||
queryKey: ['userExistsUserid', usrid],
|
||||
queryFn: async () => await userExistsUserid(usrid),
|
||||
enabled: !!usrid && usrid.trim().length > 0, // usrid가 있을 때만 실행
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserFindAuthMethodParams,
|
||||
UserFindAuthMethodResponse
|
||||
@@ -17,8 +17,8 @@ export const userFindAuthMethod = (params: UserFindAuthMethodParams) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserFindAuthMethodMutation = (options?: UseMutationOptions<UserFindAuthMethodResponse, CBDCAxiosError, UserFindAuthMethodParams>) => {
|
||||
const mutation = useMutation<UserFindAuthMethodResponse, CBDCAxiosError, UserFindAuthMethodParams>({
|
||||
export const useUserFindAuthMethodMutation = (options?: UseMutationOptions<UserFindAuthMethodResponse, NiceAxiosError, UserFindAuthMethodParams>) => {
|
||||
const mutation = useMutation<UserFindAuthMethodResponse, NiceAxiosError, UserFindAuthMethodParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserFindAuthMethodParams) => userFindAuthMethod(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserFindParams,
|
||||
UserFindResponse
|
||||
@@ -17,8 +17,8 @@ export const userFind = (params: UserFindParams) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserFindMutation = (options?: UseMutationOptions<UserFindResponse, CBDCAxiosError, UserFindParams>) => {
|
||||
const mutation = useMutation<UserFindResponse, CBDCAxiosError, UserFindParams>({
|
||||
export const useUserFindMutation = (options?: UseMutationOptions<UserFindResponse, NiceAxiosError, UserFindParams>) => {
|
||||
const mutation = useMutation<UserFindResponse, NiceAxiosError, UserFindParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserFindParams) => userFind(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserMenuPermissionsParams,
|
||||
UserMenuPermissionsResponse
|
||||
@@ -17,8 +17,8 @@ export const userMenuPermissions = (params: UserMenuPermissionsParams) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserMenuPermissionsMutation = (options?: UseMutationOptions<UserMenuPermissionsResponse, CBDCAxiosError, UserMenuPermissionsParams>) => {
|
||||
const mutation = useMutation<UserMenuPermissionsResponse, CBDCAxiosError, UserMenuPermissionsParams>({
|
||||
export const useUserMenuPermissionsMutation = (options?: UseMutationOptions<UserMenuPermissionsResponse, NiceAxiosError, UserMenuPermissionsParams>) => {
|
||||
const mutation = useMutation<UserMenuPermissionsResponse, NiceAxiosError, UserMenuPermissionsParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserMenuPermissionsParams) => userMenuPermissions(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserMenuPermissionsSaveParams,
|
||||
UserMenuPermissionsSaveResponse
|
||||
@@ -17,8 +17,8 @@ export const userMenuPermissionsSave = (params: UserMenuPermissionsSaveParams) =
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserMenuPermissionsSaveMutation = (options?: UseMutationOptions<UserMenuPermissionsSaveResponse, CBDCAxiosError, UserMenuPermissionsSaveParams>) => {
|
||||
const mutation = useMutation<UserMenuPermissionsSaveResponse, CBDCAxiosError, UserMenuPermissionsSaveParams>({
|
||||
export const useUserMenuPermissionsSaveMutation = (options?: UseMutationOptions<UserMenuPermissionsSaveResponse, NiceAxiosError, UserMenuPermissionsSaveParams>) => {
|
||||
const mutation = useMutation<UserMenuPermissionsSaveResponse, NiceAxiosError, UserMenuPermissionsSaveParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserMenuPermissionsSaveParams) => userMenuPermissionsSave(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserModifyAuthMethodParams,
|
||||
UserModifyAuthMethodResponse
|
||||
@@ -17,8 +17,8 @@ export const userModifyAuthMethod = (params: UserModifyAuthMethodParams) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserModifyAuthMethodMutation = (options?: UseMutationOptions<UserModifyAuthMethodResponse, CBDCAxiosError, UserModifyAuthMethodParams>) => {
|
||||
const mutation = useMutation<UserModifyAuthMethodResponse, CBDCAxiosError, UserModifyAuthMethodParams>({
|
||||
export const useUserModifyAuthMethodMutation = (options?: UseMutationOptions<UserModifyAuthMethodResponse, NiceAxiosError, UserModifyAuthMethodParams>) => {
|
||||
const mutation = useMutation<UserModifyAuthMethodResponse, NiceAxiosError, UserModifyAuthMethodParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserModifyAuthMethodParams) => userModifyAuthMethod(params),
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import { NiceAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserUpdatePermissionsParams,
|
||||
UserUpdatePermissionsResponse
|
||||
@@ -17,8 +17,8 @@ export const userUpdatePermissions = (params: UserUpdatePermissionsParams) => {
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserUpdatePermissionsMutation = (options?: UseMutationOptions<UserUpdatePermissionsResponse, CBDCAxiosError, UserUpdatePermissionsParams>) => {
|
||||
const mutation = useMutation<UserUpdatePermissionsResponse, CBDCAxiosError, UserUpdatePermissionsParams>({
|
||||
export const useUserUpdatePermissionsMutation = (options?: UseMutationOptions<UserUpdatePermissionsResponse, NiceAxiosError, UserUpdatePermissionsParams>) => {
|
||||
const mutation = useMutation<UserUpdatePermissionsResponse, NiceAxiosError, UserUpdatePermissionsParams>({
|
||||
...options,
|
||||
mutationFn: (params: UserUpdatePermissionsParams) => userUpdatePermissions(params),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user