From 0ee600b21838edaf9a4c9b0ff4c45c649364ad55 Mon Sep 17 00:00:00 2001
From: Jungu Lee <100949102+jobkaeHenry@users.noreply.github.com>
Date: Thu, 9 Nov 2023 22:22:49 +0900
Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8-=EA=B8=B0=EB=8A=A5-?=
=?UTF-8?q?=EA=B5=AC=ED=98=84=20(#21)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* New : 로그인 관련 타입정의
* New : React Query Dev tool 설치
* New : React Query Dev tool 설치
* New : Custom Error handler 추가
* Bug : Storybook 빌드 에러 해결
* New : 로그인 기능 서버 연결
---
client/package-lock.json | 27 +++++++++++++
client/package.json | 1 +
client/src/app/layout.tsx | 2 +
.../src/components/user/signin/SigninForm.tsx | 40 ++++++++++++++-----
client/src/const/serverPath.ts | 8 ++++
client/src/hooks/useLogin.ts | 22 ++++++----
client/src/hooks/useSetCookie.ts | 15 +++++++
client/src/mocks/handlers/getPostDetail.ts | 2 +-
client/src/mocks/handlers/getPostList.ts | 2 +-
client/src/queries/auth/useLoginMutation.tsx | 40 +++++++++++++++++++
client/src/queries/auth/useUserInfoQuery.tsx | 33 +++++++++++++++
.../queries/post/useGetPostDetailQuery.tsx | 3 +-
.../src/queries/post/useGetPostListQuery.tsx | 4 +-
.../Components/Post/PostCard.stories.tsx | 39 ++++++++++++------
client/src/types/auth/myInfo.ts | 13 ++++++
client/src/types/auth/signin.ts | 4 --
client/src/types/auth/signinRequirement.ts | 10 +++++
client/src/types/auth/signinResponse.ts | 9 +++++
client/src/types/auth/signupRequirement.ts | 18 +++++++++
client/src/utils/errorHandler.ts | 3 ++
20 files changed, 256 insertions(+), 39 deletions(-)
create mode 100644 client/src/const/serverPath.ts
create mode 100644 client/src/hooks/useSetCookie.ts
create mode 100644 client/src/queries/auth/useLoginMutation.tsx
create mode 100644 client/src/queries/auth/useUserInfoQuery.tsx
create mode 100644 client/src/types/auth/myInfo.ts
delete mode 100644 client/src/types/auth/signin.ts
create mode 100644 client/src/types/auth/signinRequirement.ts
create mode 100644 client/src/types/auth/signinResponse.ts
create mode 100644 client/src/types/auth/signupRequirement.ts
create mode 100644 client/src/utils/errorHandler.ts
diff --git a/client/package-lock.json b/client/package-lock.json
index 73d26ca..54f63de 100644
--- a/client/package-lock.json
+++ b/client/package-lock.json
@@ -13,6 +13,7 @@
"@mui/icons-material": "^5.14.15",
"@mui/material": "^5.14.15",
"@tanstack/react-query": "^5.8.1",
+ "@tanstack/react-query-devtools": "^5.8.1",
"axios": "^1.6.0",
"framer-motion": "^10.16.4",
"next": "14.0.0",
@@ -7162,6 +7163,15 @@
"url": "https://github.com/sponsors/tannerlinsley"
}
},
+ "node_modules/@tanstack/query-devtools": {
+ "version": "5.7.4",
+ "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.7.4.tgz",
+ "integrity": "sha512-wx+gwRZUZq7ISXKFJgaAYvVPt+DwTaLKlzaVLB9SLBFIzcL8Jz8jDQGR9ZQp7/O7SVj0TohS8aFuiiGzQUvWyg==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ }
+ },
"node_modules/@tanstack/react-query": {
"version": "5.8.1",
"resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.8.1.tgz",
@@ -7187,6 +7197,23 @@
}
}
},
+ "node_modules/@tanstack/react-query-devtools": {
+ "version": "5.8.1",
+ "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.8.1.tgz",
+ "integrity": "sha512-sE6El2Yj98LlPDzf2Ju9IjWPZvqh2RgoQZ+Jomrfm80uA1HlHUvhXuOB0mOcyc706ZpNpL54no59JbgpHcMuUg==",
+ "dependencies": {
+ "@tanstack/query-devtools": "5.7.4"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/tannerlinsley"
+ },
+ "peerDependencies": {
+ "@tanstack/react-query": "^5.8.1",
+ "react": "^18.0.0",
+ "react-dom": "^18.0.0"
+ }
+ },
"node_modules/@testing-library/dom": {
"version": "9.3.3",
"resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.3.tgz",
diff --git a/client/package.json b/client/package.json
index 6341c78..acf7906 100644
--- a/client/package.json
+++ b/client/package.json
@@ -18,6 +18,7 @@
"@mui/icons-material": "^5.14.15",
"@mui/material": "^5.14.15",
"@tanstack/react-query": "^5.8.1",
+ "@tanstack/react-query-devtools": "^5.8.1",
"axios": "^1.6.0",
"framer-motion": "^10.16.4",
"next": "14.0.0",
diff --git a/client/src/app/layout.tsx b/client/src/app/layout.tsx
index 4eaccf4..1ea7660 100644
--- a/client/src/app/layout.tsx
+++ b/client/src/app/layout.tsx
@@ -8,6 +8,7 @@ import NavigationBar from "~/components/NavigationBar";
import "./globals.css";
import MSWInit from "@/components/mock/MSWInit";
import CustomQueryClientProvider from "@/components/queryClient/CustomQueryClientProvider";
+import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
export const metadata: Metadata = {
title: `${nameOfApp} | ${oneLineMessage}`,
@@ -42,6 +43,7 @@ export default function RootLayout({
+