From c50ae647a452e67e2c9f601042a7917907644a46 Mon Sep 17 00:00:00 2001 From: darkdulgi Date: Thu, 22 Aug 2024 11:48:50 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[design]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20=EC=9D=B4=EB=AF=B8=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=A1=B4=EC=9E=AC=20=EC=8B=9C=20=EC=B6=9C=EB=A0=A5=20=EB=AC=B8?= =?UTF-8?q?=EA=B5=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mainPage/shared/auth/requestAuthCode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mainPage/shared/auth/requestAuthCode.js b/src/mainPage/shared/auth/requestAuthCode.js index 86abff61..ef5e38a2 100644 --- a/src/mainPage/shared/auth/requestAuthCode.js +++ b/src/mainPage/shared/auth/requestAuthCode.js @@ -11,7 +11,7 @@ async function requestAuthCode(name, phoneNumber) { } catch (e) { return handleError({ 400: "잘못된 요청 형식입니다.", - 409: "등록된 참여자 정보가 있습니다.", + 409: "이미 등록된 전화번호가 존재합니다. 하단의 '이미 정보를 입력하신 적이 있으신가요?'를 클릭하세요.", })(e); } } From 91002573fb0851563e510230fb50040816a28171 Mon Sep 17 00:00:00 2001 From: darkdulgi Date: Thu, 22 Aug 2024 12:11:05 +0900 Subject: [PATCH 2/4] =?UTF-8?q?[fix]=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EA=B2=80=EC=83=89=20=EC=8B=9C=20?= =?UTF-8?q?=EA=B7=9C=EA=B2=A9=EC=97=90=20=EB=A7=9E=EB=8A=94=20id=EC=9D=98?= =?UTF-8?q?=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=EB=93=A4=EB=A7=8C=20=EA=B2=80?= =?UTF-8?q?=EC=83=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/adminPage/features/comment/index.jsx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/adminPage/features/comment/index.jsx b/src/adminPage/features/comment/index.jsx index f55f36ef..a9df5623 100644 --- a/src/adminPage/features/comment/index.jsx +++ b/src/adminPage/features/comment/index.jsx @@ -20,12 +20,17 @@ export default function AdminComment() { } function onChangeForm(e) { - const newString = e.target.value.replace(/[^0-9]/g, ""); - const filteredFormString = formString.replace(/[^0-9]/g, ""); + let newString = e.target.value.replace(/[^0-9]/g, ""); - if (newString.length > 9) return; + if (!newString) { + newString = ""; + } else if (newString.length <= 6) { + newString = "HD_" + newString; + } else if (newString.length <= 9) { + newString = "HD_" + newString.slice(0, 6) + "_" + newString.slice(6); + } else return; - if (newString !== filteredFormString) { + if (newString !== formString) { if (newString.length >= 6) { setSelectedEvent(-1); setIsSpread(true); @@ -34,13 +39,7 @@ export default function AdminComment() { setIsSpread(false); } } - if (!newString) { - setFormString(""); - } else if (newString.length <= 6) { - setFormString("HD_" + newString); - } else { - setFormString("HD_" + newString.slice(0, 6) + "_" + newString.slice(6)); - } + setFormString(newString); } function searchEvent(e, eventId) { From 51c27bf41cf845ff290df54e84ceff8b9993a2eb Mon Sep 17 00:00:00 2001 From: darkdulgi Date: Thu, 22 Aug 2024 15:43:22 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[fix]=20=EA=B8=B0=EB=8C=80=ED=8F=89=20?= =?UTF-8?q?=EC=9E=91=EC=84=B1=20=EC=8B=9C=EA=B0=84=20=ED=98=84=EC=A7=80?= =?UTF-8?q?=EC=8B=9C=EA=B0=84=EC=9C=BC=EB=A1=9C=20=ED=91=9C=EA=B8=B0,=20?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=20api=EC=A3=BC=EC=86=8C=20=EC=9D=B8=EC=9E=90?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../features/comment/id/Comments.jsx | 19 +++---------------- src/mainPage/shared/auth/requestAuthCode.js | 3 ++- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/adminPage/features/comment/id/Comments.jsx b/src/adminPage/features/comment/id/Comments.jsx index c307213d..42758649 100644 --- a/src/adminPage/features/comment/id/Comments.jsx +++ b/src/adminPage/features/comment/id/Comments.jsx @@ -1,5 +1,6 @@ import { useQuery } from "@common/dataFetch/getQuery.js"; import { fetchServer } from "@common/dataFetch/fetchServer.js"; +import { formatDate } from "@common/utils.js"; import Pagination from "@admin/components/Pagination"; import { useState } from "react"; @@ -27,20 +28,6 @@ export default function Comments({ [page, searchString], ); - function getDate(createdAt) { - const yy = createdAt.slice(2, 4); - const mm = createdAt.slice(5, 7); - const dd = createdAt.slice(8, 10); - return `${yy}-${mm}-${dd}`; - } - - function getTime(createdAt) { - const hh = createdAt.slice(11, 13); - const mm = createdAt.slice(14, 16); - const ss = createdAt.slice(17, 19); - return `${hh}:${mm}:${ss}`; - } - function checkComment(id) { if (checkedComments.has(id)) { setCheckedComments((oldSet) => { @@ -69,9 +56,9 @@ export default function Comments({ />
- {getDate(comment.createdAt)} + {formatDate(comment.createdAt, "YY-MM-DD")} - {getTime(comment.createdAt)} + {formatDate(comment.createdAt, "hh:mm:ss")}
{comment.content} diff --git a/src/mainPage/shared/auth/requestAuthCode.js b/src/mainPage/shared/auth/requestAuthCode.js index ef5e38a2..69cd415e 100644 --- a/src/mainPage/shared/auth/requestAuthCode.js +++ b/src/mainPage/shared/auth/requestAuthCode.js @@ -1,9 +1,10 @@ import { fetchServer, handleError } from "@/common/dataFetch/fetchServer.js"; +import { EVENT_ID } from "@common/constants"; async function requestAuthCode(name, phoneNumber) { try { const body = { name, phoneNumber: phoneNumber.replace(/\D+/g, "") }; - await fetchServer("/api/v1/event-user/send-auth", { + await fetchServer(`/api/v1/event-user/send-auth/${EVENT_ID}`, { method: "post", body, }); From e04d7b5d74bad12c30fb6d65df22e85113aa0994 Mon Sep 17 00:00:00 2001 From: darkdulgi Date: Thu, 22 Aug 2024 17:45:36 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[fix]=20=EC=96=B4=EB=93=9C=EB=AF=BC=20?= =?UTF-8?q?=EC=84=A0=EC=B0=A9=EC=88=9C=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95/=EC=83=9D=EC=84=B1=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=ED=98=84=EC=9E=AC=EB=82=A0=EC=A7=9C=EB=B3=B4=EB=8B=A4=20?= =?UTF-8?q?=EC=9D=B4=EC=A0=84/=EA=B0=99=EC=9D=80=20=EB=82=A0=EC=A7=9C?= =?UTF-8?q?=EB=A1=9C=20=EC=84=A4=EC=A0=95=ED=95=98=EB=8A=94=20=EA=B2=83?= =?UTF-8?q?=EC=9D=84=20=EB=A7=89=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../features/eventEdit/FcfsInput/FcfsItemInput.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/adminPage/features/eventEdit/FcfsInput/FcfsItemInput.jsx b/src/adminPage/features/eventEdit/FcfsInput/FcfsItemInput.jsx index 836b142f..94825ca5 100644 --- a/src/adminPage/features/eventEdit/FcfsInput/FcfsItemInput.jsx +++ b/src/adminPage/features/eventEdit/FcfsInput/FcfsItemInput.jsx @@ -3,8 +3,9 @@ import { EventEditDispatchContext } from "../businessLogic/context.js"; import { Input } from "@admin/components/SmallInput.jsx"; import DateInput from "@admin/components/DateInput"; import DeleteButton from "@admin/components/DeleteButton"; -import { formatDate, padNumber } from "@common/utils.js"; +import { formatDate, padNumber, getDayDifference } from "@common/utils.js"; import fcfsInputGridStyle from "./tableStyle.js"; +import serverTimeStore from "@admin/serverTime/store.js"; const MINUTE = 60; @@ -34,9 +35,10 @@ function FcfsItemInput({ uniqueKey, date, start, end, participantCount, prizeInf ) : ( - dispatch({ type: "modify_fcfs_item", key: uniqueKey, value: { date } }) - } + setDate={(date) => { + if (getDayDifference(serverTimeStore.getState().serverTime, date) <= 0) return; + dispatch({ type: "modify_fcfs_item", key: uniqueKey, value: { date } }); + }} required size="4" />