- 사용자 로그인 인증정보 관리 기능 구현 (이메일/휴대폰 추가/삭제) - 사용자 추가 기능 구현 (실시간 ID 중복 검증 포함) - 사용자 목록 조회 기능 구현 - API 엔드포인트 오류 수정 (userExistsUserid: GET → POST, URL 경로 수정) - TypeScript 타입 오류 수정 (UseQueryOptions, UserCreateParams/Response) - 이메일/휴대폰 형식 검증 및 중복 방지 로직 추가 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
30 lines
945 B
TypeScript
30 lines
945 B
TypeScript
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 {
|
|
UserFindAuthMethodParams,
|
|
UserFindAuthMethodResponse
|
|
} from '../model/types';
|
|
import {
|
|
useMutation,
|
|
UseMutationOptions
|
|
} from '@tanstack/react-query';
|
|
|
|
export const userFindAuthMethod = (params: UserFindAuthMethodParams) => {
|
|
return resultify(
|
|
axios.post<UserFindAuthMethodResponse>(API_URL_USER.findAuthMethod(), params),
|
|
);
|
|
};
|
|
|
|
export const useUserFindAuthMethodMutation = (options?: UseMutationOptions<UserFindAuthMethodResponse, CBDCAxiosError, UserFindAuthMethodParams>) => {
|
|
const mutation = useMutation<UserFindAuthMethodResponse, CBDCAxiosError, UserFindAuthMethodParams>({
|
|
...options,
|
|
mutationFn: (params: UserFindAuthMethodParams) => userFindAuthMethod(params),
|
|
});
|
|
|
|
return {
|
|
...mutation,
|
|
};
|
|
};
|