From 991e69d93eee7c1c0fd6c7cbd3d528e8282e80da Mon Sep 17 00:00:00 2001 From: unique0902 Date: Sun, 22 Sep 2024 21:37:03 +0900 Subject: [PATCH 1/5] Feat: add boothTime in boothDetailAdd, boothEdit --- app/globals.css | 10 ++ src/features/booth/index.ts | 1 + src/features/booth/ui/BoothTimeForm.tsx | 101 ++++++++++++++++++ src/shared/lib/types.ts | 2 + .../model/store/booth-details-draft-store.ts | 24 +++++ src/shared/model/store/booth-edit-store.ts | 22 ++++ src/widgets/booth/model/booth-edit.ts | 11 ++ src/widgets/booth/ui/Add.tsx | 25 +++++ src/widgets/booth/ui/Edit.tsx | 25 +++++ 9 files changed, 221 insertions(+) create mode 100644 src/features/booth/ui/BoothTimeForm.tsx diff --git a/app/globals.css b/app/globals.css index b5c61c9..a6f1d05 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,3 +1,13 @@ @tailwind base; @tailwind components; @tailwind utilities; + +@layer utilities { + /* Tailwind에서 시계 아이콘 숨기기 */ + .no-calendar-indicator::-webkit-calendar-picker-indicator { + display: none; + } + .no-calendar-indicator::-moz-focus-inner { + border: 0; + } +} diff --git a/src/features/booth/index.ts b/src/features/booth/index.ts index db4942e..2340031 100644 --- a/src/features/booth/index.ts +++ b/src/features/booth/index.ts @@ -1,6 +1,7 @@ export { EditImageBox as BoothEditImageBox } from "./ui/EditImageBox"; export { EditMenuBox as BoothEditMenuBox } from "./ui/EditMenuBox"; export { EditTextBox as BoothEditTextBox } from "./ui/EditTextBox"; +export { BoothTimeForm } from "./ui/BoothTimeForm"; export { DeleteButton as BoothDeleteButton } from "./ui/DeleteButton"; export { EditButton as BoothEditButton } from "./ui/EditButton"; diff --git a/src/features/booth/ui/BoothTimeForm.tsx b/src/features/booth/ui/BoothTimeForm.tsx new file mode 100644 index 0000000..4ccf033 --- /dev/null +++ b/src/features/booth/ui/BoothTimeForm.tsx @@ -0,0 +1,101 @@ +import { Button } from "@/src/shared/ui/button"; +import React, { useRef, useState } from "react"; + +interface BoothTimeProps { + openTime?: string; + closeTime?: string; + editOpenTime: (openTime: string) => void; + editCloseTime: (closeTime: string) => void; + resetBoothTime: () => void; +} + +export function BoothTimeForm({ + openTime, + closeTime, + editCloseTime, + editOpenTime, + resetBoothTime, +}: BoothTimeProps) { + const openTimeInputRef = useRef(null); + const closeTimeInputRef = useRef(null); + + // 인풋 태그를 클릭했을 때 focus 이벤트를 트리거 + const handleInputClick = ( + ref: React.MutableRefObject, + ) => { + if (ref.current) { + ref.current.showPicker(); // 시간 선택 창을 강제로 엶 + } + }; + + const convertToHHMM = (time: string): string => { + // 문자열을 ':'로 분할하여 [hours, minutes, seconds] 배열을 얻음 + const [hours, minutes] = time.split(":"); + + // 'hh:mm' 형식으로 리턴 + return `${hours}:${minutes}`; + }; + const convertToHHMMSS = (time: string): string => { + const [hours, minutes] = time.split(":"); + + // 'hh:mm:ss' 형식으로 리턴 + return `${hours}:${minutes}:00`; + }; + + const convertedOpenTime = openTime ? convertToHHMM(openTime) : "00:00"; + const convertedCloseTime = closeTime ? convertToHHMM(closeTime) : "00:00"; + + return ( + <> + {!!openTime && !!closeTime ? ( + <> +
+

시작 시간

+ { + if (e.target.value) { + editOpenTime(convertToHHMMSS(e.target.value)); + } + }} + onClick={() => handleInputClick(openTimeInputRef)} // 클릭 시 시간 선택 창 열림 + value={convertedOpenTime} + /> +
+
+

종료 시간

+ { + if (e.target.value) { + editCloseTime(convertToHHMMSS(e.target.value)); + } + }} + onClick={() => handleInputClick(closeTimeInputRef)} // 클릭 시 시간 선택 창 열림 + value={convertedCloseTime} + /> +
+ + ) : ( + <> + + + )} + + ); +} diff --git a/src/shared/lib/types.ts b/src/shared/lib/types.ts index a0cc603..f279d52 100644 --- a/src/shared/lib/types.ts +++ b/src/shared/lib/types.ts @@ -21,6 +21,8 @@ export interface Booth { longitude: number; menus: Product[]; enabled?: boolean; + openTime?: string; + closeTime?: string; } export interface Member { diff --git a/src/shared/model/store/booth-details-draft-store.ts b/src/shared/model/store/booth-details-draft-store.ts index 738fa08..5e1b776 100644 --- a/src/shared/model/store/booth-details-draft-store.ts +++ b/src/shared/model/store/booth-details-draft-store.ts @@ -23,6 +23,9 @@ export type BoothDetailsDraftActions = { editDescription: (newDescription: string) => void; editPosition: (newPosition: Position) => void; editThumbnail: (url: string) => void; + editOpenTime: (openTime: string) => void; + editCloseTime: (closeTime: string) => void; + resetBoothTime: () => void; reset: () => void; addMenuItem: () => void; editMenuItem: (id: number, menuProp: Partial) => void; @@ -47,6 +50,8 @@ export const defaultInitState = { location: "", latitude: CampusPosition.latitude, longitude: CampusPosition.longitude, + openTime: undefined, + closeTime: undefined, menus: [], } satisfies Omit; @@ -73,6 +78,16 @@ export const createBoothDetailsDraftStore = })), editThumbnail: (url) => set((state) => ({ ...state, thumbnail: url })), + editOpenTime: (openTime) => + set((state) => ({ ...state, openTime })), + editCloseTime: (closeTime) => + set((state) => ({ ...state, closeTime })), + resetBoothTime: () => + set((state) => ({ + ...state, + openTime: undefined, + closeTime: undefined, + })), reset: () => set((state) => ({ ...state, ...defaultInitState })), addMenuItem: () => set((state) => ({ @@ -121,7 +136,16 @@ export const createBoothDetailsDraftStore = })), editThumbnail: (url) => set((state) => ({ ...state, thumbnail: url })), + editOpenTime: (openTime) => set((state) => ({ ...state, openTime })), + editCloseTime: (closeTime) => + set((state) => ({ ...state, closeTime })), reset: () => set((state) => ({ ...state, ...defaultInitState })), + resetBoothTime: () => + set((state) => ({ + ...state, + openTime: undefined, + closeTime: undefined, + })), addMenuItem: () => set((state) => ({ ...state, diff --git a/src/shared/model/store/booth-edit-store.ts b/src/shared/model/store/booth-edit-store.ts index 1d2e408..3afa7f6 100644 --- a/src/shared/model/store/booth-edit-store.ts +++ b/src/shared/model/store/booth-edit-store.ts @@ -28,6 +28,9 @@ export type BoothDraftActions = { editDescription: (newDescription: string) => void; editPosition: (newPosition: Position) => void; editThumbnail: (url: string) => void; + editOpenTime: (openTime: string) => void; + editCloseTime: (closeTime: string) => void; + resetBoothTime: () => void; reset: () => void; addMenuItem: () => void; editMenuItem: (id: number, menuProp: Partial) => void; @@ -75,6 +78,16 @@ export const createBoothEditStore = })), editThumbnail: (url) => set((state) => ({ ...state, thumbnail: url })), + editOpenTime: (openTime) => + set((state) => ({ ...state, openTime })), + editCloseTime: (closeTime) => + set((state) => ({ ...state, closeTime })), + resetBoothTime: () => + set((state) => ({ + ...state, + openTime: undefined, + closeTime: undefined, + })), reset: () => set((state) => ({ ...state, ...defaultInitState })), addMenuItem: () => set((state) => ({ @@ -121,6 +134,15 @@ export const createBoothEditStore = })), editThumbnail: (url) => set((state) => ({ ...state, thumbnail: url })), + editOpenTime: (openTime) => set((state) => ({ ...state, openTime })), + editCloseTime: (closeTime) => + set((state) => ({ ...state, closeTime })), + resetBoothTime: () => + set((state) => ({ + ...state, + openTime: undefined, + closeTime: undefined, + })), reset: () => set((state) => ({ ...state, ...defaultInitState })), addMenuItem: () => set((state) => ({ diff --git a/src/widgets/booth/model/booth-edit.ts b/src/widgets/booth/model/booth-edit.ts index 0d206ed..25e5c49 100644 --- a/src/widgets/booth/model/booth-edit.ts +++ b/src/widgets/booth/model/booth-edit.ts @@ -2,6 +2,9 @@ import { BoothCategory } from "@/src/shared/lib/types"; import { getMessage } from "@/src/shared/model/zod"; import { z } from "zod"; +// "HH:mm:ss" 형식을 위한 정규식 (00:00:00 ~ 23:59:59 범위) +const timeRegex = /^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d$/; + export const boothEditSchema = z.object({ category: z.nativeEnum(BoothCategory, getMessage("올바른 선택지가 아닙니다")), name: z.string().min(1, getMessage("제목을 입력해주세요")), @@ -13,4 +16,12 @@ export const boothEditSchema = z.object({ .max(100, getMessage("최대 100자까지 입력 가능합니다")), latitude: z.number(), longitude: z.number(), + openTime: z + .string() + .regex(timeRegex, getMessage("시간은 HH:mm:ss 형식이어야 합니다")) + .nullable(), // null 허용 + closeTime: z + .string() + .regex(timeRegex, getMessage("시간은 HH:mm:ss 형식이어야 합니다")) + .nullable(), // null 허용 }); diff --git a/src/widgets/booth/ui/Add.tsx b/src/widgets/booth/ui/Add.tsx index ea94933..23a94a6 100644 --- a/src/widgets/booth/ui/Add.tsx +++ b/src/widgets/booth/ui/Add.tsx @@ -42,6 +42,7 @@ import { useRouter } from "next/navigation"; import { MenuItemState } from "@/src/shared/model/store/booth-edit-store"; import { deleteMenuItem } from "@/src/features/menu/model/menu"; import { useBoothDetailsDraftStore } from "@/src/shared/model/provider/booth-details-draft-store-provider"; +import { BoothTimeForm } from "@/src/features/booth"; interface MenuItem { id: number; @@ -63,7 +64,12 @@ export function Add({ boothId }: { boothId: number }) { longitude, menuList, thumbnail, + openTime, + closeTime, editThumbnail, + editOpenTime, + editCloseTime, + resetBoothTime, addMenuItem, editMenuItem, removeMemuItem, @@ -78,7 +84,12 @@ export function Add({ boothId }: { boothId: number }) { state.longitude, state.menus, state.thumbnail, + state.openTime, + state.closeTime, state.editThumbnail, + state.editOpenTime, + state.editCloseTime, + state.resetBoothTime, state.addMenuItem, state.editMenuItem, state.removeMenuItem, @@ -98,6 +109,8 @@ export function Add({ boothId }: { boothId: number }) { description, latitude, longitude, + openTime, + closeTime, }, }); @@ -283,6 +296,18 @@ export function Add({ boothId }: { boothId: number }) { )} /> + + + 운영시간 + + + 메뉴 diff --git a/src/widgets/booth/ui/Edit.tsx b/src/widgets/booth/ui/Edit.tsx index 85e90a7..04fd308 100644 --- a/src/widgets/booth/ui/Edit.tsx +++ b/src/widgets/booth/ui/Edit.tsx @@ -41,6 +41,7 @@ import { editBooth } from "@/src/features/booth/api/booth"; import { useRouter } from "next/navigation"; import { MenuItemState } from "@/src/shared/model/store/booth-edit-store"; import { deleteMenuItem } from "@/src/features/menu/model/menu"; +import { BoothTimeForm } from "@/src/features/booth"; interface MenuItem { id: number; @@ -61,7 +62,12 @@ export function Edit({ boothId }: { boothId: number }) { latitude, longitude, thumbnail, + openTime, + closeTime, editThumbnail, + editOpenTime, + editCloseTime, + resetBoothTime, menuList, addMenuItem, editMenuItem, @@ -77,7 +83,12 @@ export function Edit({ boothId }: { boothId: number }) { state.latitude, state.longitude, state.thumbnail, + state.openTime, + state.closeTime, state.editThumbnail, + state.editOpenTime, + state.editCloseTime, + state.resetBoothTime, state.menus, state.addMenuItem, state.editMenuItem, @@ -100,6 +111,8 @@ export function Edit({ boothId }: { boothId: number }) { description, latitude, longitude, + openTime, + closeTime, }, }); @@ -287,6 +300,18 @@ export function Edit({ boothId }: { boothId: number }) { )} /> + + + 운영시간 + + + 메뉴 From 0ea9bf081d8529bb14e20b120f3ed7e39d311cdf Mon Sep 17 00:00:00 2001 From: unique0902 Date: Sun, 22 Sep 2024 21:48:12 +0900 Subject: [PATCH 2/5] Fix: change booth openTime, closeTime type undefined to null --- src/features/booth/ui/BoothTimeForm.tsx | 4 ++-- src/shared/lib/types.ts | 4 ++-- src/shared/model/store/booth-details-draft-store.ts | 4 ++-- src/shared/model/store/booth-edit-store.ts | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/features/booth/ui/BoothTimeForm.tsx b/src/features/booth/ui/BoothTimeForm.tsx index 4ccf033..1a0e081 100644 --- a/src/features/booth/ui/BoothTimeForm.tsx +++ b/src/features/booth/ui/BoothTimeForm.tsx @@ -2,8 +2,8 @@ import { Button } from "@/src/shared/ui/button"; import React, { useRef, useState } from "react"; interface BoothTimeProps { - openTime?: string; - closeTime?: string; + openTime: string | null; + closeTime: string | null; editOpenTime: (openTime: string) => void; editCloseTime: (closeTime: string) => void; resetBoothTime: () => void; diff --git a/src/shared/lib/types.ts b/src/shared/lib/types.ts index f279d52..f8c9589 100644 --- a/src/shared/lib/types.ts +++ b/src/shared/lib/types.ts @@ -21,8 +21,8 @@ export interface Booth { longitude: number; menus: Product[]; enabled?: boolean; - openTime?: string; - closeTime?: string; + openTime: string | null; + closeTime: string | null; } export interface Member { diff --git a/src/shared/model/store/booth-details-draft-store.ts b/src/shared/model/store/booth-details-draft-store.ts index 5e1b776..1c7ce1b 100644 --- a/src/shared/model/store/booth-details-draft-store.ts +++ b/src/shared/model/store/booth-details-draft-store.ts @@ -50,8 +50,8 @@ export const defaultInitState = { location: "", latitude: CampusPosition.latitude, longitude: CampusPosition.longitude, - openTime: undefined, - closeTime: undefined, + openTime: null, + closeTime: null, menus: [], } satisfies Omit; diff --git a/src/shared/model/store/booth-edit-store.ts b/src/shared/model/store/booth-edit-store.ts index 3afa7f6..8c9a149 100644 --- a/src/shared/model/store/booth-edit-store.ts +++ b/src/shared/model/store/booth-edit-store.ts @@ -54,6 +54,8 @@ export const defaultInitState = { location: "", latitude: CampusPosition.latitude, longitude: CampusPosition.longitude, + openTime: null, + closeTime: null, menus: [], } satisfies Omit; From 8474cc7eb9362dc37ac331862fc873168ea39fa5 Mon Sep 17 00:00:00 2001 From: unique0902 Date: Sun, 22 Sep 2024 21:59:48 +0900 Subject: [PATCH 3/5] Fix: fix sync form booth time error --- src/features/booth/ui/BoothTimeForm.tsx | 8 ++++++++ src/widgets/booth/ui/Add.tsx | 9 +++++++++ src/widgets/booth/ui/Edit.tsx | 8 ++++++++ 3 files changed, 25 insertions(+) diff --git a/src/features/booth/ui/BoothTimeForm.tsx b/src/features/booth/ui/BoothTimeForm.tsx index 1a0e081..a3225c2 100644 --- a/src/features/booth/ui/BoothTimeForm.tsx +++ b/src/features/booth/ui/BoothTimeForm.tsx @@ -6,6 +6,8 @@ interface BoothTimeProps { closeTime: string | null; editOpenTime: (openTime: string) => void; editCloseTime: (closeTime: string) => void; + changeOpenTimeInForm: (openTime: string | null) => void; + changeCloseTimeInForm: (openTime: string | null) => void; resetBoothTime: () => void; } @@ -14,6 +16,8 @@ export function BoothTimeForm({ closeTime, editCloseTime, editOpenTime, + changeOpenTimeInForm, + changeCloseTimeInForm, resetBoothTime, }: BoothTimeProps) { const openTimeInputRef = useRef(null); @@ -59,6 +63,7 @@ export function BoothTimeForm({ onChange={(e) => { if (e.target.value) { editOpenTime(convertToHHMMSS(e.target.value)); + changeOpenTimeInForm(convertToHHMMSS(e.target.value)); } }} onClick={() => handleInputClick(openTimeInputRef)} // 클릭 시 시간 선택 창 열림 @@ -75,6 +80,7 @@ export function BoothTimeForm({ onChange={(e) => { if (e.target.value) { editCloseTime(convertToHHMMSS(e.target.value)); + changeCloseTimeInForm(convertToHHMMSS(e.target.value)); } }} onClick={() => handleInputClick(closeTimeInputRef)} // 클릭 시 시간 선택 창 열림 @@ -90,6 +96,8 @@ export function BoothTimeForm({ onClick={() => { editOpenTime("13:00:00"); editCloseTime("18:00:00"); + changeOpenTimeInForm("13:00:00"); + changeCloseTimeInForm("18:00:00"); }} > 운영시간 추가하기 diff --git a/src/widgets/booth/ui/Add.tsx b/src/widgets/booth/ui/Add.tsx index 23a94a6..6e371c1 100644 --- a/src/widgets/booth/ui/Add.tsx +++ b/src/widgets/booth/ui/Add.tsx @@ -114,6 +114,13 @@ export function Add({ boothId }: { boothId: number }) { }, }); + const changeOpenTimeInForm = (openTime: string | null) => { + form.setValue("openTime", openTime); + }; + const changeCloseTimeInForm = (closeTime: string | null) => { + form.setValue("closeTime", closeTime); + }; + const [parent] = useAutoAnimate(); const router = useRouter(); @@ -302,6 +309,8 @@ export function Add({ boothId }: { boothId: number }) { { + form.setValue("openTime", openTime); + }; + const changeCloseTimeInForm = (closeTime: string | null) => { + form.setValue("closeTime", closeTime); + }; const { reset } = form; @@ -306,6 +312,8 @@ export function Edit({ boothId }: { boothId: number }) { Date: Sun, 22 Sep 2024 22:15:43 +0900 Subject: [PATCH 4/5] Fix: fix resetBoothTime undefined to null --- src/shared/model/store/booth-details-draft-store.ts | 8 ++++---- src/shared/model/store/booth-edit-store.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/shared/model/store/booth-details-draft-store.ts b/src/shared/model/store/booth-details-draft-store.ts index 1c7ce1b..c906361 100644 --- a/src/shared/model/store/booth-details-draft-store.ts +++ b/src/shared/model/store/booth-details-draft-store.ts @@ -85,8 +85,8 @@ export const createBoothDetailsDraftStore = resetBoothTime: () => set((state) => ({ ...state, - openTime: undefined, - closeTime: undefined, + openTime: null, + closeTime: null, })), reset: () => set((state) => ({ ...state, ...defaultInitState })), addMenuItem: () => @@ -143,8 +143,8 @@ export const createBoothDetailsDraftStore = resetBoothTime: () => set((state) => ({ ...state, - openTime: undefined, - closeTime: undefined, + openTime: null, + closeTime: null, })), addMenuItem: () => set((state) => ({ diff --git a/src/shared/model/store/booth-edit-store.ts b/src/shared/model/store/booth-edit-store.ts index 8c9a149..f91ce8e 100644 --- a/src/shared/model/store/booth-edit-store.ts +++ b/src/shared/model/store/booth-edit-store.ts @@ -87,8 +87,8 @@ export const createBoothEditStore = resetBoothTime: () => set((state) => ({ ...state, - openTime: undefined, - closeTime: undefined, + openTime: null, + closeTime: null, })), reset: () => set((state) => ({ ...state, ...defaultInitState })), addMenuItem: () => @@ -142,8 +142,8 @@ export const createBoothEditStore = resetBoothTime: () => set((state) => ({ ...state, - openTime: undefined, - closeTime: undefined, + openTime: null, + closeTime: null, })), reset: () => set((state) => ({ ...state, ...defaultInitState })), addMenuItem: () => From 37afd75f13497ec66e93a1c00f19611067c157e2 Mon Sep 17 00:00:00 2001 From: Chan Date: Sun, 22 Sep 2024 14:31:29 +0000 Subject: [PATCH 5/5] fix: add missing properties in type declaration --- mocks/api/constants/booths.ts | 14 ++++++++++++++ mocks/api/constants/members.ts | 14 ++++++++++++++ src/features/booth/api/addBooth.ts | 2 ++ src/shared/model/store/booth-draft-store.ts | 2 ++ 4 files changed, 32 insertions(+) diff --git a/mocks/api/constants/booths.ts b/mocks/api/constants/booths.ts index 5288635..813acad 100644 --- a/mocks/api/constants/booths.ts +++ b/mocks/api/constants/booths.ts @@ -15,8 +15,12 @@ export const booths: Booth[] = [ longitude: 0.0, menus: [], enabled: true, + openTime: null, + closeTime: null, }, { + openTime: null, + closeTime: null, id: 1, name: "부동산학관 부스", category: "FOOD", @@ -56,6 +60,8 @@ export const booths: Booth[] = [ enabled: false, }, { + openTime: null, + closeTime: null, id: 2, name: "공대주점", category: "BAR", @@ -112,6 +118,8 @@ export const booths: Booth[] = [ enabled: true, }, { + openTime: null, + closeTime: null, id: 3, name: "생명대 화장실", category: "TOILET", @@ -126,6 +134,8 @@ export const booths: Booth[] = [ enabled: true, }, { + openTime: null, + closeTime: null, id: 4, name: "법학관 의무실", category: "MEDICAL", @@ -141,6 +151,8 @@ export const booths: Booth[] = [ enabled: true, }, { + openTime: null, + closeTime: null, id: 5, name: "유니페스", category: "EVENT", @@ -155,6 +167,8 @@ export const booths: Booth[] = [ enabled: true, }, { + openTime: null, + closeTime: null, id: 6, name: "일감호 보트", category: "EVENT", diff --git a/mocks/api/constants/members.ts b/mocks/api/constants/members.ts index 389fb9b..12771fb 100644 --- a/mocks/api/constants/members.ts +++ b/mocks/api/constants/members.ts @@ -5,6 +5,8 @@ export const member: Member = { email: "verified@email.com", booths: [ { + openTime: null, + closeTime: null, id: 0, name: "주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점주점", category: "BAR", @@ -20,6 +22,8 @@ export const member: Member = { enabled: true, }, { + openTime: null, + closeTime: null, id: 1, name: "부동산학관 부스", category: "FOOD", @@ -59,6 +63,8 @@ export const member: Member = { enabled: false, }, { + openTime: null, + closeTime: null, id: 2, name: "공대주점", category: "BAR", @@ -115,6 +121,8 @@ export const member: Member = { enabled: true, }, { + openTime: null, + closeTime: null, id: 3, name: "생명대 화장실", category: "TOILET", @@ -129,6 +137,8 @@ export const member: Member = { enabled: true, }, { + openTime: null, + closeTime: null, id: 4, name: "법학관 의무실", category: "MEDICAL", @@ -144,6 +154,8 @@ export const member: Member = { enabled: true, }, { + openTime: null, + closeTime: null, id: 5, name: "유니페스", category: "EVENT", @@ -158,6 +170,8 @@ export const member: Member = { enabled: true, }, { + openTime: null, + closeTime: null, id: 6, name: "일감호 보트", category: "EVENT", diff --git a/src/features/booth/api/addBooth.ts b/src/features/booth/api/addBooth.ts index 7a46d8a..56f45a3 100644 --- a/src/features/booth/api/addBooth.ts +++ b/src/features/booth/api/addBooth.ts @@ -30,6 +30,8 @@ interface BoothForCreate { menus: ProductForCreate[]; enabled?: boolean; festivalId: number; + openTime: null | string; + closeTime: null | string; } // TODO add body export const addBooth = async (accessToken: string, booth: Booth) => { diff --git a/src/shared/model/store/booth-draft-store.ts b/src/shared/model/store/booth-draft-store.ts index 742216a..1032ad7 100644 --- a/src/shared/model/store/booth-draft-store.ts +++ b/src/shared/model/store/booth-draft-store.ts @@ -35,6 +35,8 @@ export const defaultInitState = { latitude: CampusPosition.latitude, longitude: CampusPosition.longitude, menus: [], + openTime: null, + closeTime: null, } satisfies BoothDraftState; export const createBoothDraftStore =