사용자 계정 관리 기능 구현 및 API 오류 수정
- 사용자 로그인 인증정보 관리 기능 구현 (이메일/휴대폰 추가/삭제) - 사용자 추가 기능 구현 (실시간 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>
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL } from '@/shared/api/urls';
|
||||
import { API_URL_USER } from '@/shared/api/api-url-user';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
UserExistsUseridParams,
|
||||
UserExistsUseridResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
@@ -11,16 +10,16 @@ import {
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const userExistsUserid = (params: UserExistsUseridParams) => {
|
||||
export const userExistsUserid = (usrId: string) => {
|
||||
return resultify(
|
||||
axios.post<UserExistsUseridResponse>(API_URL.userExistsUserid(), params),
|
||||
axios.post<UserExistsUseridResponse>(API_URL_USER.userExistsUserid(usrId)),
|
||||
);
|
||||
};
|
||||
|
||||
export const useUserExistsUseridMutation = (options?: UseMutationOptions<UserExistsUseridResponse, CBDCAxiosError, UserExistsUseridParams>) => {
|
||||
const mutation = useMutation<UserExistsUseridResponse, CBDCAxiosError, UserExistsUseridParams>({
|
||||
export const useUserExistsUseridMutation = (options?: UseMutationOptions<UserExistsUseridResponse, CBDCAxiosError, string>) => {
|
||||
const mutation = useMutation<UserExistsUseridResponse, CBDCAxiosError, string>({
|
||||
...options,
|
||||
mutationFn: (params: UserExistsUseridParams) => userExistsUserid(params),
|
||||
mutationFn: (usrId: string) => userExistsUserid(usrId),
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user