From 5348bcfe92840c56a12fbb59ecaeb6c14ea16ffb Mon Sep 17 00:00:00 2001 From: shinmj Date: Thu, 30 Dec 2021 21:54:18 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 예약 물품 조회 시 인터넷 예약만 조회됨 -> 모든 예약물품 조회 --- .../admin/src/components/Wrapper/GlobalError.tsx | 12 ++++++------ frontend/admin/src/pages/reserve-item/index.tsx | 1 + frontend/admin/src/service/ReserveItem.ts | 4 ++++ frontend/admin/src/stores/error.ts | 3 ++- .../src/components/Reserve/ReserveItemAdditional.tsx | 4 ++++ .../src/components/Reserve/ReserveItemInfo.tsx | 4 ++++ frontend/portal/src/pages/auth/logout/index.tsx | 1 - .../portal/src/pages/reserve/[category]/[id].tsx | 2 +- frontend/portal/src/pages/user/leave/index.tsx | 1 - frontend/portal/src/pages/user/reserve/index.tsx | 8 +------- frontend/portal/src/service/Reserve.ts | 1 + 11 files changed, 24 insertions(+), 17 deletions(-) diff --git a/frontend/admin/src/components/Wrapper/GlobalError.tsx b/frontend/admin/src/components/Wrapper/GlobalError.tsx index 48876d5..48609ce 100644 --- a/frontend/admin/src/components/Wrapper/GlobalError.tsx +++ b/frontend/admin/src/components/Wrapper/GlobalError.tsx @@ -1,10 +1,10 @@ -import React, { useEffect, useState } from 'react' -import { createStyles, makeStyles, Theme } from '@material-ui/core/styles' -import { useSnackbar } from 'notistack' -import { errorStateAtom } from '@stores' -import { useRecoilState } from 'recoil' import CustomAlert from '@components/CustomAlert' import { ButtonProps } from '@material-ui/core/Button' +import { createStyles, makeStyles, Theme } from '@material-ui/core/styles' +import { errorStateAtom } from '@stores' +import { useSnackbar } from 'notistack' +import React, { useEffect, useState } from 'react' +import { useRecoilState } from 'recoil' const useStyles = makeStyles((theme: Theme) => createStyles({ @@ -39,7 +39,7 @@ const GlobalError = () => { if (errorState.error) { if (errorState.status === 400) { const errors = errorState.errors.map(item => { - return item.defaultMessage + return item.defaultMessage || item.message }) setAlertState({ diff --git a/frontend/admin/src/pages/reserve-item/index.tsx b/frontend/admin/src/pages/reserve-item/index.tsx index 982a6c3..09ca288 100644 --- a/frontend/admin/src/pages/reserve-item/index.tsx +++ b/frontend/admin/src/pages/reserve-item/index.tsx @@ -205,6 +205,7 @@ const ReserveItem = (props: ReserveItemProps) => { categoryId: keywordState?.categoryId !== 'all' ? keywordState?.categoryId : null, isUse: Boolean(handlePopup), + isPopup: Boolean(handlePopup), }) //목록 조회 diff --git a/frontend/admin/src/service/ReserveItem.ts b/frontend/admin/src/service/ReserveItem.ts index e33ca3d..bdea851 100644 --- a/frontend/admin/src/service/ReserveItem.ts +++ b/frontend/admin/src/service/ReserveItem.ts @@ -106,6 +106,7 @@ interface ReserveItemSearchPayload extends SearchPayload { locationId?: string categoryId?: string isUse?: boolean + isPopup?: boolean } export const reserveItemService = { @@ -117,6 +118,7 @@ export const reserveItemService = { locationId, categoryId, isUse = false, + isPopup = false, }: ReserveItemSearchPayload) => { return useSWR( [ @@ -126,6 +128,7 @@ export const reserveItemService = { locationId, categoryId, isUse, + isPopup, ], url => common.fetcher(url, { @@ -134,6 +137,7 @@ export const reserveItemService = { locationId, categoryId, isUse, + isPopup, }), { revalidateOnFocus: false, errorRetryCount: 0 }, diff --git a/frontend/admin/src/stores/error.ts b/frontend/admin/src/stores/error.ts index b43a8a7..8bacf01 100644 --- a/frontend/admin/src/stores/error.ts +++ b/frontend/admin/src/stores/error.ts @@ -1,6 +1,6 @@ +import { DEFAULT_ERROR_MESSAGE } from '@constants' import { AxiosError } from 'axios' import { atom, DefaultValue, selector } from 'recoil' -import { DEFAULT_ERROR_MESSAGE } from '@constants' /** * Global error 상태관리 @@ -10,6 +10,7 @@ interface IErrors { defaultMessage: string field: string rejectedValue?: string + message?: string } export interface IErrorProps { diff --git a/frontend/portal/src/components/Reserve/ReserveItemAdditional.tsx b/frontend/portal/src/components/Reserve/ReserveItemAdditional.tsx index 8a50407..f40c053 100644 --- a/frontend/portal/src/components/Reserve/ReserveItemAdditional.tsx +++ b/frontend/portal/src/components/Reserve/ReserveItemAdditional.tsx @@ -27,6 +27,10 @@ const ReserveItemAdditional = ({ data }: ReserveItemAdditionalPropps) => {
{t('reserve_item.contact')}
{data.contact}
+
+
{'주소'}
+
{data.address}
+
)}

{t('reserve_item.manager')}

diff --git a/frontend/portal/src/components/Reserve/ReserveItemInfo.tsx b/frontend/portal/src/components/Reserve/ReserveItemInfo.tsx index 3183f67..d96aebc 100644 --- a/frontend/portal/src/components/Reserve/ReserveItemInfo.tsx +++ b/frontend/portal/src/components/Reserve/ReserveItemInfo.tsx @@ -27,6 +27,10 @@ const ReserveItemInfo = ({ data, reserveStatus }: ReserveItemInfoProps) => {
{t('reserve_item.name')}
{data.reserveItemName}
+
+
{'예약방법'}
+
{data.reserveMethodName}
+
{`${t('reserve.count')}/${t('reserve.number_of_people')}`}
{data.totalQty}
diff --git a/frontend/portal/src/pages/auth/logout/index.tsx b/frontend/portal/src/pages/auth/logout/index.tsx index 8081d6f..5cfc31d 100644 --- a/frontend/portal/src/pages/auth/logout/index.tsx +++ b/frontend/portal/src/pages/auth/logout/index.tsx @@ -21,7 +21,6 @@ export const getServerSideProps: GetServerSideProps = async ({ res, query, }) => { - console.log(query) if (!process.browser) { const Cookies = require('cookies') const cookies = new Cookies(req, res) diff --git a/frontend/portal/src/pages/reserve/[category]/[id].tsx b/frontend/portal/src/pages/reserve/[category]/[id].tsx index 6bc11ab..26649ba 100644 --- a/frontend/portal/src/pages/reserve/[category]/[id].tsx +++ b/frontend/portal/src/pages/reserve/[category]/[id].tsx @@ -37,7 +37,7 @@ const ReserveDetail = ({ initData }: ReserveDetailProps) => { }, ] - if (initData?.isPossible) { + if (initData?.isPossible && initData?.reserveMethodId === 'internet') { buttons.push({ id: 'item-edit-button', title: t('reserve_item.request'), diff --git a/frontend/portal/src/pages/user/leave/index.tsx b/frontend/portal/src/pages/user/leave/index.tsx index 30a2a77..d2b9cf8 100644 --- a/frontend/portal/src/pages/user/leave/index.tsx +++ b/frontend/portal/src/pages/user/leave/index.tsx @@ -40,7 +40,6 @@ const UserLeave = () => { // 탈퇴 처리 const leave = async (data: IVerification) => { - console.log('leave', data) try { const result = await userService.leave(data) if (result === true) { diff --git a/frontend/portal/src/pages/user/reserve/index.tsx b/frontend/portal/src/pages/user/reserve/index.tsx index 0411a2a..da527f8 100644 --- a/frontend/portal/src/pages/user/reserve/index.tsx +++ b/frontend/portal/src/pages/user/reserve/index.tsx @@ -22,7 +22,7 @@ import { conditionAtom, conditionValue, userAtom } from '@stores' import { rownum } from '@utils' import { GetServerSideProps } from 'next' import { useRouter } from 'next/router' -import React, { createRef, useEffect, useMemo, useState } from 'react' +import React, { createRef, useMemo, useState } from 'react' import { TFunction, useTranslation } from 'react-i18next' import { useRecoilValue } from 'recoil' @@ -239,12 +239,6 @@ const UserReserve = (props: UserReserveProps) => { keywordState?.categoryId !== 'all' ? keywordState?.categoryId : null, }) - useEffect(() => { - if (data) { - console.log(data) - } - }, [data]) - const handleSearch = () => { if (page === 0) { mutate(data, false) diff --git a/frontend/portal/src/service/Reserve.ts b/frontend/portal/src/service/Reserve.ts index 83b3a8e..e8996ce 100644 --- a/frontend/portal/src/service/Reserve.ts +++ b/frontend/portal/src/service/Reserve.ts @@ -147,6 +147,7 @@ export const reserveService = { locationId, categoryId, isUse: true, + isPopup: false, }), { revalidateOnFocus: false, errorRetryCount: 0 }, ),