From 7bb83173a9aac1aa1af0e6455ef8d5038fd22fd5 Mon Sep 17 00:00:00 2001 From: darkdulgi Date: Thu, 22 Aug 2024 19:00:45 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[fix]=20=EC=98=A4=EB=A5=98=EB=A1=9C=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=B0=9B=EC=95=84=EC=98=A4?= =?UTF-8?q?=EC=A7=80=20=EB=AA=BB=ED=96=88=EC=9D=84=20=EC=8B=9C=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/adminPage/features/comment/id/Comments.jsx | 2 ++ src/adminPage/features/users/Users.jsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/adminPage/features/comment/id/Comments.jsx b/src/adminPage/features/comment/id/Comments.jsx index 42758649..274cf1ee 100644 --- a/src/adminPage/features/comment/id/Comments.jsx +++ b/src/adminPage/features/comment/id/Comments.jsx @@ -23,7 +23,9 @@ export default function Comments({ return res; }) .catch((e) => { + alert("통신 오류로 기대평 로드 실패."); console.log(e); + return { comments: [] }; }), [page, searchString], ); diff --git a/src/adminPage/features/users/Users.jsx b/src/adminPage/features/users/Users.jsx index 9ad1ad0f..8cbe44bd 100644 --- a/src/adminPage/features/users/Users.jsx +++ b/src/adminPage/features/users/Users.jsx @@ -15,7 +15,9 @@ export default function Comments({ searchString, category }) { return res; }) .catch((e) => { + alert("통신 오류로 유저 목록 로드 실패.") console.log(e); + return { users: [] }; }), [page, searchString], ); From 9f766d52101afa50a0270ad2fb576c13b81188e0 Mon Sep 17 00:00:00 2001 From: darkdulgi Date: Thu, 22 Aug 2024 19:21:33 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[fix]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20api?= =?UTF-8?q?=EC=97=90=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20frameid=20=EC=A0=84?= =?UTF-8?q?=EC=86=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mainPage/features/fcfs/cardGame/CardGame.jsx | 2 +- src/mainPage/features/fcfs/mock.js | 6 +++--- src/mainPage/shared/auth/UserFind/requestLogin.js | 3 ++- src/mainPage/shared/auth/mock.js | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mainPage/features/fcfs/cardGame/CardGame.jsx b/src/mainPage/features/fcfs/cardGame/CardGame.jsx index 9719ffb8..10dcf102 100644 --- a/src/mainPage/features/fcfs/cardGame/CardGame.jsx +++ b/src/mainPage/features/fcfs/cardGame/CardGame.jsx @@ -53,7 +53,7 @@ function CardGame({ offline }) { } async function getCardAnswerOnline(index) { - const fetchConfig = { method: "post", body: { eventAnswer: index } }; + const fetchConfig = { method: "post", body: { answer: index } }; try { const { answerResult, winner } = await fetchServer( `/api/v1/event/fcfs/${EVENT_FCFS_ID}`, diff --git a/src/mainPage/features/fcfs/mock.js b/src/mainPage/features/fcfs/mock.js index 2572ae8f..990ccc7a 100644 --- a/src/mainPage/features/fcfs/mock.js +++ b/src/mainPage/features/fcfs/mock.js @@ -23,15 +23,15 @@ const handlers = [ return HttpResponse.json(false); }), http.post("/api/v1/event/fcfs/:eventFrameId", async ({ request }) => { - const { eventAnswer } = await request.json(); + const { answer } = await request.json(); - const answerResult = eventAnswer === 3; + const answerResult = answer === 3; const winner = false; const token = request.headers.get("authorization"); if (token === null) return HttpResponse.json(false, { status: 401 }); - if (typeof eventAnswer !== "number") return HttpResponse.json(false, { status: 400 }); + if (typeof answer !== "number") return HttpResponse.json(false, { status: 400 }); return HttpResponse.json({ answerResult, winner }); }), diff --git a/src/mainPage/shared/auth/UserFind/requestLogin.js b/src/mainPage/shared/auth/UserFind/requestLogin.js index b3f79849..7fc7ca2f 100644 --- a/src/mainPage/shared/auth/UserFind/requestLogin.js +++ b/src/mainPage/shared/auth/UserFind/requestLogin.js @@ -1,9 +1,10 @@ import { fetchServer, handleError } from "@common/dataFetch/fetchServer.js"; +import { EVENT_ID } from "@common/constants"; async function requestLogin(name, phoneNumber) { try { const body = { name, phoneNumber: phoneNumber.replace(/\D+/g, "") }; - const { token } = await fetchServer("/api/v1/event-user/login", { + const { token } = await fetchServer(`/api/v1/event-user/login/${EVENT_ID}`, { method: "post", body, }); diff --git a/src/mainPage/shared/auth/mock.js b/src/mainPage/shared/auth/mock.js index bb670130..46f4563b 100644 --- a/src/mainPage/shared/auth/mock.js +++ b/src/mainPage/shared/auth/mock.js @@ -8,7 +8,7 @@ const token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ0ZWFtLW9yYW5nZSIsImlhdCI6MTcyNDA0NDc5MCwiZXhwIjoxNzI0MDQ4MzkwLCJzdWIiOiJldmVudFVzZXIiLCJ1c2VyTmFtZSI6Iuq5gOyCoeu6qSIsInVzZXJJZCI6ImtpbXBpcHB5YXAiLCJyb2xlIjoiZXZlbnRfdXNlciJ9.m5m_PkwmYz5Mt-kjn28435bQtwgph3WO-2J42X82lCg"; const handlers = [ - http.post("/api/v1/event-user/send-auth", async ({ request }) => { + http.post("/api/v1/event-user/send-auth/:eventFrameId", async ({ request }) => { const { name, phoneNumber } = await request.json(); if (phoneNumber === "01019991999") return HttpResponse.json({ error: "중복된 사용자가 있음" }, { status: 409 }); @@ -28,7 +28,7 @@ const handlers = [ return HttpResponse.json({ token }); }), - http.post("/api/v1/event-user/login", async ({ request }) => { + http.post("/api/v1/event-user/login/:eventFrameId", async ({ request }) => { const { name, phoneNumber } = await request.json(); if (!isValidInput(name, phoneNumber))