feat: common 폴더 최신화

This commit is contained in:
2025-03-11 15:48:32 +09:00
parent 58a0c5f1de
commit 7262a03ec7
8 changed files with 113 additions and 32 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
import { Client } from "@common/network";
import { SERVER_API_URL, SITE_ID } from "../config";
import { BASE_URL, SITE_ID } from "../config";
export const client = Client.getInstance({
baseURL: SERVER_API_URL as string,
siteId: SITE_ID as string,
baseURL: BASE_URL,
siteId: SITE_ID,
});
+36 -6
View File
@@ -1,15 +1,45 @@
import { useMutation } from "@tanstack/react-query";
import { useQuery } from "@tanstack/react-query";
import { ENDPOINT } from "../config";
import { client } from "./client";
export interface UserInfo {
export interface IUser {
regDt: string;
mdfcnDt: string;
rgtr: string;
mdfr: string;
userUnqId: string;
userId: string;
userName: string;
email: string;
encryptedPassword: string;
refreshToken: string;
userStateCode: string;
lastLoginDate: string;
loginFailCount: number;
pswdHnt: string;
pswdAns: string;
mphn: string;
telno: string;
zip: string;
addr: string;
daddr: string;
laeSeCd: string;
ogdpSeCd: string;
aprvYn: string;
autzrId: string;
expryYmd: string;
lastPswdChgDt: string;
googleId: string;
kakaoId: string;
naverId: string;
isSocialUser: boolean;
hasPassword: boolean;
}
export const useUsersMutation = () => {
return useMutation({
mutationFn: ({ userUniqId }: { userUniqId: string }) =>
client.put<UserInfo>(`${ENDPOINT.USER_SERVICE.USERS}/${userUniqId}`),
export const useUsersQuery = ({ userUniqId }: { userUniqId: string }) => {
return useQuery({
queryKey: [ENDPOINT.USER_SERVICE.USERS],
queryFn: () =>
client.get<IUser>(`${ENDPOINT.USER_SERVICE.USERS}/${userUniqId}`),
});
};