취소 비밀번호 변경 기능 추가 및 사용자 계정 관리 개선
🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
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 {
|
||||
ChangeCancelPasswordParams,
|
||||
ChangeCancelPasswordResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const userChangeCancelPassword = (params: ChangeCancelPasswordParams) => {
|
||||
return resultify(
|
||||
axios.post<ChangeCancelPasswordResponse>(API_URL_USER.userChangeCancelPassword(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserChangeCancelPasswordMutation = (options?: UseMutationOptions<ChangeCancelPasswordResponse, CBDCAxiosError, ChangeCancelPasswordParams>) => {
|
||||
const mutation = useMutation<ChangeCancelPasswordResponse, CBDCAxiosError, ChangeCancelPasswordParams>({
|
||||
...options,
|
||||
mutationFn: (params: ChangeCancelPasswordParams) => userChangeCancelPassword(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -133,9 +133,9 @@ export interface UserMenuPermissionData {
|
||||
}
|
||||
|
||||
export interface ChangePasswordParams {
|
||||
mid: string;
|
||||
usrid: string;
|
||||
password: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
export interface ChangePasswordResponse {
|
||||
@@ -143,6 +143,16 @@ export interface ChangePasswordResponse {
|
||||
error?: ErrorResponse;
|
||||
}
|
||||
|
||||
export interface ChangeCancelPasswordParams {
|
||||
mid: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface ChangeCancelPasswordResponse {
|
||||
status: boolean;
|
||||
error?: ErrorResponse;
|
||||
}
|
||||
|
||||
export interface VerificationsItem {
|
||||
type: string;
|
||||
contact: string;
|
||||
|
||||
Reference in New Issue
Block a user