From e732a5d33c0bd4d6005831ff109c67c532e2972c Mon Sep 17 00:00:00 2001 From: DongHyeonWon Date: Tue, 1 Oct 2024 09:36:15 +0900 Subject: [PATCH] test --- backend/src/configs/typeorm.config.ts | 2 +- backend/src/item/item.controller.ts | 1 + backend/src/main.ts | 1 - frontend/src/components/comments/comment/Comment.jsx | 1 + frontend/src/pages/LoginPage/LoginPage.jsx | 7 ------- 5 files changed, 3 insertions(+), 9 deletions(-) diff --git a/backend/src/configs/typeorm.config.ts b/backend/src/configs/typeorm.config.ts index b57d47c..8b69555 100644 --- a/backend/src/configs/typeorm.config.ts +++ b/backend/src/configs/typeorm.config.ts @@ -13,7 +13,7 @@ export class typeORMConfig implements TypeOrmOptionsFactory { database: process.env.TYPEORM_DATABASE, timezone: '+09:00', entities: [__dirname + '/../**/*.entity.{js,ts}'], - synchronize: true, + synchronize: false, }; } } diff --git a/backend/src/item/item.controller.ts b/backend/src/item/item.controller.ts index 609645d..8f94d32 100644 --- a/backend/src/item/item.controller.ts +++ b/backend/src/item/item.controller.ts @@ -68,6 +68,7 @@ export class ItemController { ): Promise { const token = req.cookies['accessToken']; // 쿠키에서 accessToken 읽기 let userId: string | null = null; + if (token) { try { const decoded = this.jwtService.verify(token, { diff --git a/backend/src/main.ts b/backend/src/main.ts index f4afe0d..21b3e89 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -9,7 +9,6 @@ async function bootstrap() { const port = process.env.PORT || 80; const app = await NestFactory.create(AppModule); app.enableCors({ - origin: true, methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS', credentials: true, }); diff --git a/frontend/src/components/comments/comment/Comment.jsx b/frontend/src/components/comments/comment/Comment.jsx index 3a4bee5..a593ede 100644 --- a/frontend/src/components/comments/comment/Comment.jsx +++ b/frontend/src/components/comments/comment/Comment.jsx @@ -10,6 +10,7 @@ export default function Comment(props) { const { mutate: bestCommentLikeMutate } = useBestCommentLike(props.commentId, props.itemId); const { mutate: commentLikeMutate } = useCommentLike(props.commentId, props.itemId); const { mutate: deleteCommentMutate } = useDeleteComment(props.commentId, props.itemId); + const handleClick = () => { if (props.isBest) { bestCommentLikeMutate({ isHeart: props.isHeart }); diff --git a/frontend/src/pages/LoginPage/LoginPage.jsx b/frontend/src/pages/LoginPage/LoginPage.jsx index 645ef3c..772d9a9 100644 --- a/frontend/src/pages/LoginPage/LoginPage.jsx +++ b/frontend/src/pages/LoginPage/LoginPage.jsx @@ -8,18 +8,11 @@ export default function LoginPage() { }&redirect_uri=${import.meta.env.VITE_KAKAO_REDIRECT_URI}`; }; - const handleCreateUser = () => { - fetch('http://localhost/user/create', { - method: 'POST', - credentials: 'include', - }); - }; return ( <> 로그인 시 댓글 작성과 밸런스게임 제작이 가능합니다 -
);