From 4c8e34660d7c108521beef1af787edccb5aa8b8c Mon Sep 17 00:00:00 2001 From: userjmmm Date: Wed, 31 Jul 2024 13:26:31 +0900 Subject: [PATCH 01/19] =?UTF-8?q?chore:=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EB=B0=8F=20=EA=B4=80=EC=8B=AC=EB=AA=A9=EB=A1=9D=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=A4=80=EB=B9=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- depcheck-result.json | 1 + src/api/hooks/useGetCategorys.ts | 21 +++++++++++++++++++++ update-package-json.js | 23 +++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 depcheck-result.json create mode 100644 src/api/hooks/useGetCategorys.ts create mode 100644 update-package-json.js diff --git a/depcheck-result.json b/depcheck-result.json new file mode 100644 index 000000000..d4728759a --- /dev/null +++ b/depcheck-result.json @@ -0,0 +1 @@ +{"dependencies":["glob"],"devDependencies":["@emotion/eslint-plugin","@storybook/addon-essentials","@storybook/addon-interactions","@storybook/addon-links","@storybook/addon-onboarding","@storybook/blocks","@storybook/preset-create-react-app","@storybook/react-webpack5","@storybook/test","@testing-library/user-event","@types/jest","@types/node","@typescript-eslint/eslint-plugin","@typescript-eslint/parser","eslint","eslint-config-airbnb","eslint-config-airbnb-typescript","eslint-config-prettier","eslint-config-react-app","eslint-plugin-import","eslint-plugin-json-format","eslint-plugin-jsx-a11y","eslint-plugin-prettier","eslint-plugin-react","eslint-plugin-react-hooks","eslint-plugin-simple-import-sort","eslint-plugin-storybook","jest","prettier","prop-types","tsconfig-paths-webpack-plugin","webpack"],"missing":{},"using":{"@babel/plugin-proposal-private-property-in-object":["/Users/a/qqu/kateCam/step2/week6/react-deploy/babel.config.js"],"@craco/craco":["/Users/a/qqu/kateCam/step2/week6/react-deploy/package.json"],"cross-env":["/Users/a/qqu/kateCam/step2/week6/react-deploy/package.json"],"storybook":["/Users/a/qqu/kateCam/step2/week6/react-deploy/package.json"],"react-scripts":["/Users/a/qqu/kateCam/step2/week6/react-deploy/package.json"],"react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/package.json","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/components/PrivateRoute.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/provider/Auth/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Register/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Category/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useCurrentCategory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useHandleOrderHistory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useIntersectionObserver.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useOrderFormContext.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/MessageCard/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/GoodsInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/HeadingText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/LabelText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Footer.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/ScrollToTop.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/SelectFriendsBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/CategoryItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/AiDiscoveryBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryProductsSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryHeroSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/SplitLayout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Spacing/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/VisibilityLoader/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/View/LoadingView.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Spinner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/AsyncBoundary/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/instance/index.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetCategorys.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProductDetail.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProductOptions.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProducts.ts"],"@chakra-ui/react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx"],"@tanstack/react-query":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/instance/index.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetCategorys.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProductDetail.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProductOptions.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProducts.ts"],"@emotion/react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Register/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/MessageCard/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/GoodsInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/HeadingText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/LabelText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Footer.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/SelectFriendsBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/CategoryItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/AiDiscoveryBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryProductsSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryHeroSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/SplitLayout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Spacing/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/VisibilityLoader/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/View/LoadingView.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Spinner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.tsx"],"@emotion/styled":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Register/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/MessageCard/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/GoodsInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/HeadingText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/LabelText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Footer.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/SelectFriendsBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/CategoryItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/AiDiscoveryBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryProductsSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryHeroSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/SplitLayout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Spacing/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/VisibilityLoader/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/View/LoadingView.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Spinner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.tsx"],"framer-motion":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx"],"react-dom":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/components/PrivateRoute.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Category/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useHandleOrderHistory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useIntersectionObserver.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/ScrollToTop.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryProductsSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.stories.tsx"],"@types/react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/provider/Auth/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Register/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useCurrentCategory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useHandleOrderHistory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useIntersectionObserver.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/ScrollToTop.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/AsyncBoundary/index.tsx"],"@types/react-dom":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/index.tsx"],"@testing-library/jest-dom":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/setupTests.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx"],"react-router-dom":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/components/PrivateRoute.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Category/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useHandleOrderHistory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/ScrollToTop.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryProductsSection/index.tsx"],"@testing-library/react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.test.tsx"],"msw":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/browser.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/handlers.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/server.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/categories.mock.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/products.mock.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/register.mock.ts"],"typescript":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/browser.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/handlers.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/server.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/categories.mock.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/products.mock.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/register.mock.ts"],"react-intersection-observer":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useIntersectionObserver.ts"],"react-hook-form":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useOrderFormContext.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx"],"@chakra-ui/icons":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx"],"@storybook/react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.stories.tsx"],"react-error-boundary":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/AsyncBoundary/index.tsx"],"axios":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/instance/index.ts"]},"invalidFiles":{},"invalidDirs":{}} diff --git a/src/api/hooks/useGetCategorys.ts b/src/api/hooks/useGetCategorys.ts new file mode 100644 index 000000000..d93e4fc95 --- /dev/null +++ b/src/api/hooks/useGetCategorys.ts @@ -0,0 +1,21 @@ +import { useQuery } from '@tanstack/react-query'; + +import type { CategoryData } from '@/types'; + +import { BASE_URL, fetchInstance } from '../instance'; + +export type CategoryResponseData = CategoryData[]; + +export const getCategoriesPath = () => `${BASE_URL}/api/categories`; +const categoriesQueryKey = [getCategoriesPath()]; + +export const getCategories = async () => { + const response = await fetchInstance.get(getCategoriesPath()); + return response.data; +}; + +export const useGetCategories = () => + useQuery({ + queryKey: categoriesQueryKey, + queryFn: getCategories, + }); diff --git a/update-package-json.js b/update-package-json.js new file mode 100644 index 000000000..c47a1b663 --- /dev/null +++ b/update-package-json.js @@ -0,0 +1,23 @@ +const fs = require('fs'); +const path = require('path'); + +// depcheck 결과 읽기 +const depcheckResult = JSON.parse(fs.readFileSync('depcheck-result.json', 'utf-8')); +const missingDeps = depcheckResult.missing; + +// 현재 package.json 읽기 +const packageJsonPath = path.join(__dirname, 'package.json'); +const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')); + +// 누락된 의존성 추가 +Object.keys(missingDeps).forEach(dep => { + if (!packageJson.dependencies[dep] && !packageJson.devDependencies[dep]) { + // 적절한 버전 범위 설정 필요 + packageJson.dependencies[dep] = '*'; + } +}); + +// 업데이트된 package.json 저장 +fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf-8'); + +console.log('package.json has been updated with missing dependencies.'); From 9730e7a7ecf29b22d0dc0f76229d3798f097bcaf Mon Sep 17 00:00:00 2001 From: userjmmm Date: Wed, 31 Jul 2024 13:32:55 +0900 Subject: [PATCH 02/19] =?UTF-8?q?refactor:=20useGetCategories=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=AA=85=20=EC=98=A4=ED=83=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- depcheck-result.json | 1 - src/api/hooks/useGetCategorys.ts | 21 --------------------- update-package-json.js | 23 ----------------------- 3 files changed, 45 deletions(-) delete mode 100644 depcheck-result.json delete mode 100644 src/api/hooks/useGetCategorys.ts delete mode 100644 update-package-json.js diff --git a/depcheck-result.json b/depcheck-result.json deleted file mode 100644 index d4728759a..000000000 --- a/depcheck-result.json +++ /dev/null @@ -1 +0,0 @@ -{"dependencies":["glob"],"devDependencies":["@emotion/eslint-plugin","@storybook/addon-essentials","@storybook/addon-interactions","@storybook/addon-links","@storybook/addon-onboarding","@storybook/blocks","@storybook/preset-create-react-app","@storybook/react-webpack5","@storybook/test","@testing-library/user-event","@types/jest","@types/node","@typescript-eslint/eslint-plugin","@typescript-eslint/parser","eslint","eslint-config-airbnb","eslint-config-airbnb-typescript","eslint-config-prettier","eslint-config-react-app","eslint-plugin-import","eslint-plugin-json-format","eslint-plugin-jsx-a11y","eslint-plugin-prettier","eslint-plugin-react","eslint-plugin-react-hooks","eslint-plugin-simple-import-sort","eslint-plugin-storybook","jest","prettier","prop-types","tsconfig-paths-webpack-plugin","webpack"],"missing":{},"using":{"@babel/plugin-proposal-private-property-in-object":["/Users/a/qqu/kateCam/step2/week6/react-deploy/babel.config.js"],"@craco/craco":["/Users/a/qqu/kateCam/step2/week6/react-deploy/package.json"],"cross-env":["/Users/a/qqu/kateCam/step2/week6/react-deploy/package.json"],"storybook":["/Users/a/qqu/kateCam/step2/week6/react-deploy/package.json"],"react-scripts":["/Users/a/qqu/kateCam/step2/week6/react-deploy/package.json"],"react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/package.json","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/components/PrivateRoute.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/provider/Auth/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Register/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Category/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useCurrentCategory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useHandleOrderHistory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useIntersectionObserver.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useOrderFormContext.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/MessageCard/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/GoodsInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/HeadingText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/LabelText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Footer.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/ScrollToTop.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/SelectFriendsBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/CategoryItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/AiDiscoveryBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryProductsSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryHeroSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/SplitLayout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Spacing/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/VisibilityLoader/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/View/LoadingView.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Spinner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/AsyncBoundary/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/instance/index.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetCategorys.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProductDetail.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProductOptions.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProducts.ts"],"@chakra-ui/react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx"],"@tanstack/react-query":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/instance/index.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetCategorys.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProductDetail.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProductOptions.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/useGetProducts.ts"],"@emotion/react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Register/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/MessageCard/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/GoodsInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/HeadingText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/LabelText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Footer.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/SelectFriendsBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/CategoryItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/AiDiscoveryBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryProductsSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryHeroSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/SplitLayout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Spacing/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/VisibilityLoader/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/View/LoadingView.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Spinner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.tsx"],"@emotion/styled":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Register/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/MessageCard/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/GoodsInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/HeadingText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Common/LabelText.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Footer.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/SelectFriendsBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/CategoryItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/AiDiscoveryBanner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryProductsSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryHeroSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/SplitLayout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Spacing/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/VisibilityLoader/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/View/LoadingView.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Spinner/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.tsx"],"framer-motion":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx"],"react-dom":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/App.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/components/PrivateRoute.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Category/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useHandleOrderHistory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useIntersectionObserver.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/OrderInfo/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/MessageCardFields.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/ScrollToTop.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryProductsSection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.stories.tsx"],"@types/react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/provider/Auth/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Register/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/MyAccount/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useCurrentCategory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useHandleOrderHistory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useIntersectionObserver.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/ScrollToTop.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/AsyncBoundary/index.tsx"],"@types/react-dom":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/index.tsx"],"@testing-library/jest-dom":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/setupTests.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx"],"react-router-dom":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/routes/components/PrivateRoute.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Login/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Category/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useHandleOrderHistory.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/Header.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/ScrollToTop.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Layout/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Home/CategorySection/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Category/CategoryProductsSection/index.tsx"],"@testing-library/react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/pages/Goods/Detail/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionSection.test.tsx"],"msw":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/browser.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/handlers.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/server.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/categories.mock.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/products.mock.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/register.mock.ts"],"typescript":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/browser.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/handlers.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/mocks/server.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/categories.mock.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/products.mock.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/hooks/register.mock.ts"],"react-intersection-observer":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useIntersectionObserver.ts"],"react-hook-form":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/hooks/useOrderFormContext.ts","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.test.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/index.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Order/OrderForm/Fields/CashReceiptFields.tsx"],"@chakra-ui/icons":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/features/Goods/Detail/OptionItem/CountOptionItem.tsx"],"@storybook/react":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Grid/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/layouts/Container/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Image/index.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Default.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/GoodsItem/Ranking.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Form/Input/UnderlineTextField.stories.tsx","/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/Button/index.stories.tsx"],"react-error-boundary":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/components/common/AsyncBoundary/index.tsx"],"axios":["/Users/a/qqu/kateCam/step2/week6/react-deploy/src/api/instance/index.ts"]},"invalidFiles":{},"invalidDirs":{}} diff --git a/src/api/hooks/useGetCategorys.ts b/src/api/hooks/useGetCategorys.ts deleted file mode 100644 index d93e4fc95..000000000 --- a/src/api/hooks/useGetCategorys.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { useQuery } from '@tanstack/react-query'; - -import type { CategoryData } from '@/types'; - -import { BASE_URL, fetchInstance } from '../instance'; - -export type CategoryResponseData = CategoryData[]; - -export const getCategoriesPath = () => `${BASE_URL}/api/categories`; -const categoriesQueryKey = [getCategoriesPath()]; - -export const getCategories = async () => { - const response = await fetchInstance.get(getCategoriesPath()); - return response.data; -}; - -export const useGetCategories = () => - useQuery({ - queryKey: categoriesQueryKey, - queryFn: getCategories, - }); diff --git a/update-package-json.js b/update-package-json.js deleted file mode 100644 index c47a1b663..000000000 --- a/update-package-json.js +++ /dev/null @@ -1,23 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -// depcheck 결과 읽기 -const depcheckResult = JSON.parse(fs.readFileSync('depcheck-result.json', 'utf-8')); -const missingDeps = depcheckResult.missing; - -// 현재 package.json 읽기 -const packageJsonPath = path.join(__dirname, 'package.json'); -const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')); - -// 누락된 의존성 추가 -Object.keys(missingDeps).forEach(dep => { - if (!packageJson.dependencies[dep] && !packageJson.devDependencies[dep]) { - // 적절한 버전 범위 설정 필요 - packageJson.dependencies[dep] = '*'; - } -}); - -// 업데이트된 package.json 저장 -fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf-8'); - -console.log('package.json has been updated with missing dependencies.'); From 59cc0c8f6c8e3f916f8a090b411958309d6abbaa Mon Sep 17 00:00:00 2001 From: userjmmm Date: Wed, 31 Jul 2024 17:21:13 +0900 Subject: [PATCH 03/19] =?UTF-8?q?refactor:=20CategoryResponseData=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=EC=9D=84=20Pageable=EC=97=90=20=EB=A7=9E?= =?UTF-8?q?=EC=B6=94=EC=96=B4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/hooks/useGetCategories.ts | 29 ++++++++++++++++++- .../features/Home/CategorySection/index.tsx | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/api/hooks/useGetCategories.ts b/src/api/hooks/useGetCategories.ts index d93e4fc95..b0942f276 100644 --- a/src/api/hooks/useGetCategories.ts +++ b/src/api/hooks/useGetCategories.ts @@ -4,7 +4,34 @@ import type { CategoryData } from '@/types'; import { BASE_URL, fetchInstance } from '../instance'; -export type CategoryResponseData = CategoryData[]; +export type CategoryResponseData = { + totalElements: number; + totalPages: number; + first: boolean; + last: boolean; + size: number; + content: CategoryData[]; + number: number; + sort: { + empty: boolean; + sorted: boolean; + unsorted: boolean; + }; + numberOfElements: number; + pageable: { + pageNumber: number; + pageSize: number; + sort: { + empty: boolean; + sorted: boolean; + unsorted: boolean; + }; + offset: number; + paged: boolean; + unpaged: boolean; + }; + empty: boolean; +}; export const getCategoriesPath = () => `${BASE_URL}/api/categories`; const categoriesQueryKey = [getCategoriesPath()]; diff --git a/src/components/features/Home/CategorySection/index.tsx b/src/components/features/Home/CategorySection/index.tsx index f0690cfd3..33c9bf0f8 100644 --- a/src/components/features/Home/CategorySection/index.tsx +++ b/src/components/features/Home/CategorySection/index.tsx @@ -24,7 +24,7 @@ export const CategorySection = () => { md: 6, }} > - {data.map((category) => ( + {data.content.map((category) => ( From e403736f2d89040655807d0f17c23ee43198a8e2 Mon Sep 17 00:00:00 2001 From: userjmmm Date: Wed, 31 Jul 2024 20:35:16 +0900 Subject: [PATCH 04/19] =?UTF-8?q?refactor:=20=EC=98=B5=EC=85=98=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EC=8B=9C=20=EC=B4=9D=20=EA=B2=B0=EC=A0=9C?= =?UTF-8?q?=20=EA=B8=88=EC=95=A1=EC=9D=B4=20=EA=B3=84=EC=82=B0=EB=90=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/hooks/categories.mock.ts | 59 ++++++++++++++----- .../features/Goods/Detail/OptionSection.tsx | 32 ++++++++-- .../features/Home/CategorySection/index.tsx | 22 ++++++- src/hooks/useCurrentCategory.ts | 2 +- src/pages/Login/index.tsx | 23 +++++++- 5 files changed, 111 insertions(+), 27 deletions(-) diff --git a/src/api/hooks/categories.mock.ts b/src/api/hooks/categories.mock.ts index 7b1ac46f2..c1d5545eb 100644 --- a/src/api/hooks/categories.mock.ts +++ b/src/api/hooks/categories.mock.ts @@ -8,21 +8,48 @@ export const categoriesMockHandler = [ }), ]; -const CATEGORIES_RESPONSE_DATA = [ - { - id: 2920, - name: '생일', - description: '감동을 높여줄 생일 선물 리스트', - color: '#5949a3', - imageUrl: - 'https://img1.daumcdn.net/thumb/S104x104/?fname=https%3A%2F%2Ft1.daumcdn.net%2Fgift%2Fhome%2Ftheme%2F292020231106_MXMUB.png', +const CATEGORIES_RESPONSE_DATA = { + totalElements: 2, + totalPages: 1, + first: true, + last: true, + size: 10, + content: [ + { + id: 2920, + name: '생일', + description: '감동을 높여줄 생일 선물 리스트', + color: '#5949a3', + imageUrl: + 'https://img1.daumcdn.net/thumb/S104x104/?fname=https%3A%2F%2Ft1.daumcdn.net%2Fgift%2Fhome%2Ftheme%2F292020231106_MXMUB.png', + }, + { + id: 2930, + name: '교환권', + description: '놓치면 후회할 교환권 특가', + color: '#9290C3', + imageUrl: + 'https://img1.daumcdn.net/thumb/S104x104/?fname=https%3A%2F%2Fst.kakaocdn.net%2Fproduct%2Fgift%2Fproduct%2F20240131153049_5a22b137a8d346e9beb020a7a7f4254a.jpg', + }, + ], + number: 0, + sort: { + empty: true, + sorted: false, + unsorted: true, }, - { - id: 2930, - name: '교환권', - description: '놓치면 후회할 교환권 특가', - color: '#9290C3', - imageUrl: - 'https://img1.daumcdn.net/thumb/S104x104/?fname=https%3A%2F%2Fst.kakaocdn.net%2Fproduct%2Fgift%2Fproduct%2F20240131153049_5a22b137a8d346e9beb020a7a7f4254a.jpg', + numberOfElements: 2, + pageable: { + pageNumber: 0, + pageSize: 10, + sort: { + empty: true, + sorted: false, + unsorted: true, + }, + offset: 0, + paged: true, + unpaged: false, }, -]; + empty: false, +}; \ No newline at end of file diff --git a/src/components/features/Goods/Detail/OptionSection.tsx b/src/components/features/Goods/Detail/OptionSection.tsx index 31f7e9839..f32b34d1f 100644 --- a/src/components/features/Goods/Detail/OptionSection.tsx +++ b/src/components/features/Goods/Detail/OptionSection.tsx @@ -1,5 +1,5 @@ import styled from '@emotion/styled'; -import { useMemo, useState } from 'react'; +import { useMemo, useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { @@ -24,10 +24,32 @@ export const OptionSection = ({ productId }: Props) => { const { data: detail } = useGetProductDetail({ productId }); const { data: options } = useGetProductOptions({ productId }); - const [counts, setCounts] = useState({}); + const [counts, setCounts] = useState(() => { + const initialCounts: CountState = {}; + if (options) { + options.forEach(option => { + initialCounts[option.id] = '1'; + }); + } + return initialCounts; + }); + + useEffect(() => { + if (options) { + setCounts(prevCounts => { + const newCounts = { ...prevCounts }; + options.forEach(option => { + if (!newCounts[option.id]) { + newCounts[option.id] = '1'; + } + }); + return newCounts; + }); + } + }, [options]); + const totalPrice = useMemo(() => { - if (!detail) - return 0; + if (!detail) return 0; const count = Object.values(counts).reduce((acc, countStr) => acc + Number(countStr), 0); return detail.price * count; }, [detail, counts]); @@ -103,7 +125,7 @@ export const OptionSection = ({ productId }: Props) => { setCounts(prev => ({ ...prev, [option.id]: value }))} /> ))} diff --git a/src/components/features/Home/CategorySection/index.tsx b/src/components/features/Home/CategorySection/index.tsx index 33c9bf0f8..7b156dea8 100644 --- a/src/components/features/Home/CategorySection/index.tsx +++ b/src/components/features/Home/CategorySection/index.tsx @@ -8,12 +8,20 @@ import { getDynamicPath } from '@/routes/path'; import { breakpoints } from '@/styles/variants'; import { CategoryItem } from './CategoryItem'; +import { LoadingView } from '@/components/common/View/LoadingView'; export const CategorySection = () => { const { data, isLoading, isError } = useGetCategories(); - if (isLoading || isError) return null; - if (!data) return null; + if (isLoading) { + return ; + } + if (isError) { + return 문제가 발생했습니다. 나중에 다시 시도해주세요.; + } + if (!data || !data.content) { + return 카테고리가 없습니다.; + } return ( @@ -42,3 +50,13 @@ const Wrapper = styled.section` padding: 45px 52px 23px; } `; +const ErrorMessage = styled.div` + padding: 20px; + text-align: center; + color: red; +`; + +const EmptyMessage = styled.div` + padding: 20px; + text-align: center; +`; \ No newline at end of file diff --git a/src/hooks/useCurrentCategory.ts b/src/hooks/useCurrentCategory.ts index 6faad3a18..fdf273312 100644 --- a/src/hooks/useCurrentCategory.ts +++ b/src/hooks/useCurrentCategory.ts @@ -14,7 +14,7 @@ export const useCurrentCategory = ({ categoryId }: Props) => { return true; }, [data, isLoading, isError]); - const currentTheme = getCurrentCategory(categoryId, data ?? []); + const currentTheme = getCurrentCategory(categoryId, data?.content ?? []); return { isRender, diff --git a/src/pages/Login/index.tsx b/src/pages/Login/index.tsx index dab8c50b4..5b0e99edf 100644 --- a/src/pages/Login/index.tsx +++ b/src/pages/Login/index.tsx @@ -1,6 +1,6 @@ import styled from '@emotion/styled'; -import { useState } from 'react'; -import { useNavigate, useSearchParams } from 'react-router-dom'; +import { useState, useEffect } from 'react'; +import { useLocation, useNavigate, useSearchParams } from 'react-router-dom'; import KAKAO_LOGO from '@/assets/kakao_logo.svg'; import { Button } from '@/components/common/Button'; @@ -8,12 +8,25 @@ import { UnderlineTextField } from '@/components/common/Form/Input/UnderlineText import { Spacing } from '@/components/common/layouts/Spacing'; import { breakpoints } from '@/styles/variants'; import { authSessionStorage } from '@/utils/storage'; +import { BASE_URL } from '@/api/instance'; export const LoginPage = () => { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [queryParams] = useSearchParams(); const navigate = useNavigate(); + const location = useLocation(); + + useEffect(() => { + const queryParams = new URLSearchParams(location.search); + const token = queryParams.get('token'); + + if (token) { + console.log({ token }); + authSessionStorage.set(JSON.stringify({ token })); + navigate('/'); + } + }, [location, navigate]); const handleConfirm = async () => { if (!email || !password) { @@ -46,6 +59,10 @@ export const LoginPage = () => { } }; + const handleKakaoLogin = () => { + window.location.href = `${BASE_URL}/oauth/kakao`; + }; + return ( @@ -67,7 +84,7 @@ export const LoginPage = () => { From cc36364b6e5ed86e3c24977531789c4c236e82f1 Mon Sep 17 00:00:00 2001 From: userjmmm Date: Fri, 2 Aug 2024 02:47:52 +0900 Subject: [PATCH 12/19] =?UTF-8?q?refactor:=20localStorage=EB=A1=9C=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/MyAccount/index.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pages/MyAccount/index.tsx b/src/pages/MyAccount/index.tsx index 298b9648b..8c07aad39 100644 --- a/src/pages/MyAccount/index.tsx +++ b/src/pages/MyAccount/index.tsx @@ -3,8 +3,7 @@ import styled from '@emotion/styled'; import { useEffect, useState } from 'react'; import { RouterPath } from '@/routes/path'; -import { authSessionStorage } from '@/utils/storage'; -import { fetchInstance,getBaseUrl } from '@/api/instance'; +import { fetchInstance, getBaseUrl } from '@/api/instance'; interface WishlistItem { wishId: number; @@ -44,7 +43,8 @@ interface WishlistResponseData { } export const MyAccountPage = () => { - const authInfo = JSON.parse(authSessionStorage.get() || '{}'); + const authToken = localStorage.getItem('authToken'); + const authInfo = authToken ? { token: authToken } : {}; const [wishlist, setWishlist] = useState([]); const [page, setPage] = useState(0); const [totalPages, setTotalPages] = useState(0); @@ -79,7 +79,9 @@ export const MyAccountPage = () => { }; useEffect(() => { - fetchWishlist(page); + if (authInfo.token) { + fetchWishlist(page); + } }, [page, authInfo.token]); const handleDelete = async (wishId: number) => { @@ -108,7 +110,6 @@ export const MyAccountPage = () => { }; const handleLogout = () => { - authSessionStorage.set(undefined); localStorage.removeItem('authToken'); const redirectURL = `${window.location.origin}${RouterPath.home}`; @@ -118,7 +119,7 @@ export const MyAccountPage = () => { return ( - {authInfo?.email}님 안녕하세요! + {authInfo.token ? '안녕하세요!' : '로그인이 필요합니다.'} From 8999b1508cc26fcd8c03a3b5e891724c5f474112 Mon Sep 17 00:00:00 2001 From: userjmmm Date: Fri, 2 Aug 2024 10:06:22 +0900 Subject: [PATCH 13/19] =?UTF-8?q?feat:=20=EB=B3=80=EA=B2=BD=EB=90=9C=20API?= =?UTF-8?q?=EC=97=90=20=EB=A7=9E=EC=B6=B0=20=EC=9C=84=EC=8B=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../features/Goods/Detail/OptionSection.tsx | 3 +- src/pages/MyAccount/index.tsx | 30 ++++++++----------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/components/features/Goods/Detail/OptionSection.tsx b/src/components/features/Goods/Detail/OptionSection.tsx index 4a4c06ccb..6f88b9ad7 100644 --- a/src/components/features/Goods/Detail/OptionSection.tsx +++ b/src/components/features/Goods/Detail/OptionSection.tsx @@ -13,6 +13,7 @@ import { getDynamicPath, RouterPath } from '@/routes/path'; import { orderHistorySessionStorage } from '@/utils/storage'; import { CountOptionItem } from './OptionItem/CountOptionItem'; +import { getBaseUrl } from '@/api/instance'; type Props = ProductDetailRequestParams; @@ -76,7 +77,7 @@ export const OptionSection = ({ productId }: Props) => { console.log('Sending request to add wish', requestBody); // 잘 받아오는지 확인 - 추후 삭제 예정 - const response = await fetch('/api/wishes', { + const response = await fetch(`${getBaseUrl()}/api/wishes`, { method: 'POST', headers: { Authorization: `Bearer ${authInfo.token}`, diff --git a/src/pages/MyAccount/index.tsx b/src/pages/MyAccount/index.tsx index 8c07aad39..51f34c661 100644 --- a/src/pages/MyAccount/index.tsx +++ b/src/pages/MyAccount/index.tsx @@ -2,7 +2,6 @@ import { Box, Button, HStack, Image, Text, VStack } from '@chakra-ui/react'; import styled from '@emotion/styled'; import { useEffect, useState } from 'react'; -import { RouterPath } from '@/routes/path'; import { fetchInstance, getBaseUrl } from '@/api/instance'; interface WishlistItem { @@ -43,8 +42,7 @@ interface WishlistResponseData { } export const MyAccountPage = () => { - const authToken = localStorage.getItem('authToken'); - const authInfo = authToken ? { token: authToken } : {}; + const authInfo = localStorage.getItem('authToken'); const [wishlist, setWishlist] = useState([]); const [page, setPage] = useState(0); const [totalPages, setTotalPages] = useState(0); @@ -57,8 +55,9 @@ export const MyAccountPage = () => { `${getWishlistPath()}?page=${page}&size=10&sort=createdDate,desc`, { headers: { - Authorization: `Bearer ${authInfo.token}`, + Authorization: `Bearer ${authInfo}`, }, + withCredentials: true, } ); @@ -67,7 +66,7 @@ export const MyAccountPage = () => { console.log('Response data:', data); setWishlist(data.content); setTotalPages(data.totalPages); - } else if (response.status === 401) { + } else if (response.status === 403) { alert('토큰이 유효하지 않습니다. 다시 로그인해주세요.'); } else { alert('위시 리스트를 불러오는데 실패했습니다.'); @@ -79,26 +78,24 @@ export const MyAccountPage = () => { }; useEffect(() => { - if (authInfo.token) { - fetchWishlist(page); - } - }, [page, authInfo.token]); + fetchWishlist(page); + }, [page, authInfo]); const handleDelete = async (wishId: number) => { try { - const response = await fetch(`/api/wishes/${wishId}`, { + const response = await fetch(`${getBaseUrl()}/api/wishes/${wishId}`, { method: 'DELETE', headers: { - Authorization: `Bearer ${authInfo.token}`, + Authorization: `Bearer ${authInfo}`, }, }); - if (response.status === 204) { + if (response.ok) { setWishlist((prev) => prev.filter((item) => item.wishId !== wishId)); alert('관심 목록에서 삭제되었습니다.'); - } else if (response.status === 404) { + } else if (response.status === 400) { alert('관심 상품을 찾을 수 없습니다.'); - } else if (response.status === 401) { + } else if (response.status === 403) { alert('토큰이 유효하지 않습니다. 다시 로그인해주세요.'); } else { alert('관심 목록 삭제에 실패했습니다.'); @@ -111,15 +108,14 @@ export const MyAccountPage = () => { const handleLogout = () => { localStorage.removeItem('authToken'); - - const redirectURL = `${window.location.origin}${RouterPath.home}`; + const redirectURL = `${window.location.origin}`; window.location.replace(redirectURL); }; return ( - {authInfo.token ? '안녕하세요!' : '로그인이 필요합니다.'} + {authInfo ? "사용자" : "로그인이 필요합니다"}님 안녕하세요! From d61171472ebc4ab0efd256887a930924558edfcd Mon Sep 17 00:00:00 2001 From: userjmmm Date: Fri, 2 Aug 2024 10:44:09 +0900 Subject: [PATCH 14/19] =?UTF-8?q?feat:=20=ED=86=A0=ED=81=B0=20=EB=94=94?= =?UTF-8?q?=EC=BD=94=EB=94=A9=ED=95=B4=EC=84=9C=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9E=90=20=EC=9D=B4=EB=A6=84=20=EB=B0=9B=EC=95=84=EC=98=A4?= =?UTF-8?q?=EB=8A=94=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 15 +++++++++++++++ package.json | 4 +++- src/pages/MyAccount/index.tsx | 28 +++++++++++++++++++++++++++- 3 files changed, 45 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e0a8f5038..4aeeb8bef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@emotion/styled": "^11.11.0", "@tanstack/react-query": "^5.24.1", "axios": "^1.6.7", + "base-64": "^1.0.0", "framer-motion": "^11.0.6", "glob": "^11.0.0", "react": "^18.2.0", @@ -39,6 +40,7 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "@types/base-64": "^1.0.2", "@types/jest": "^27.5.2", "@types/node": "^16.18.82", "@types/react": "^18.2.57", @@ -9308,6 +9310,13 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/base-64": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/base-64/-/base-64-1.0.2.tgz", + "integrity": "sha512-uPgKMmM9fmn7I+Zi6YBqctOye4SlJsHKcisjHIMWpb2YKZRc36GpKyNuQ03JcT+oNXg1m7Uv4wU94EVltn8/cw==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/body-parser": { "version": "1.19.5", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", @@ -11693,6 +11702,12 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, + "node_modules/base-64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base-64/-/base-64-1.0.0.tgz", + "integrity": "sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==", + "license": "MIT" + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", diff --git a/package.json b/package.json index 8b38f4ba0..4774234a5 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "@emotion/styled": "^11.11.0", "@tanstack/react-query": "^5.24.1", "axios": "^1.6.7", + "base-64": "^1.0.0", "framer-motion": "^11.0.6", "glob": "^11.0.0", "react": "^18.2.0", @@ -54,6 +55,7 @@ "@testing-library/jest-dom": "^5.17.0", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^13.5.0", + "@types/base-64": "^1.0.2", "@types/jest": "^27.5.2", "@types/node": "^16.18.82", "@types/react": "^18.2.57", @@ -87,4 +89,4 @@ "overrides": { "react-refresh": "0.11.0" } -} \ No newline at end of file +} diff --git a/src/pages/MyAccount/index.tsx b/src/pages/MyAccount/index.tsx index 51f34c661..0186d26dc 100644 --- a/src/pages/MyAccount/index.tsx +++ b/src/pages/MyAccount/index.tsx @@ -1,6 +1,7 @@ import { Box, Button, HStack, Image, Text, VStack } from '@chakra-ui/react'; import styled from '@emotion/styled'; import { useEffect, useState } from 'react'; +import base64 from 'base-64'; import { fetchInstance, getBaseUrl } from '@/api/instance'; @@ -46,6 +47,31 @@ export const MyAccountPage = () => { const [wishlist, setWishlist] = useState([]); const [page, setPage] = useState(0); const [totalPages, setTotalPages] = useState(0); + const [userName, setUserName] = useState("사용자"); + + useEffect(() => { + if (authInfo) { + try { + const [headerEncoded, payloadEncoded, signature] = authInfo.split('.'); + const payload = JSON.parse(base64.decode(payloadEncoded)); + + console.log('Token Header:', JSON.parse(base64.decode(headerEncoded))); + console.log('Token Payload:', payload); + console.log('Token Signature:', signature); + console.log('Payload Keys:', Object.keys(payload)); + + if (payload.sub) { + const email = payload.sub; + const displayName = email.split('@')[0]; + setUserName(displayName); + } + } catch (error) { + console.error('토큰 디코딩 에러:', error); + } + } else { + setUserName("사용자"); + } + }, [authInfo]); const getWishlistPath = () => `${getBaseUrl()}/api/wishes`; @@ -115,7 +141,7 @@ export const MyAccountPage = () => { return ( - {authInfo ? "사용자" : "로그인이 필요합니다"}님 안녕하세요! + {authInfo ? userName : "로그인이 필요합니다"}님 안녕하세요! From 08a112bb46ff8400cf6b8bf67fa0e26f0a9c712a Mon Sep 17 00:00:00 2001 From: userjmmm Date: Fri, 2 Aug 2024 12:55:34 +0900 Subject: [PATCH 15/19] =?UTF-8?q?feat:=20=EC=A3=BC=EB=AC=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=20=EC=83=81=ED=92=88=20?= =?UTF-8?q?=EC=98=B5=EC=85=98=EA=B9=8C=EC=A7=80=20=EB=B0=9B=EC=95=84?= =?UTF-8?q?=EC=98=A4=EB=8A=94=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/hooks/useGetProductOptions.ts | 1 + .../features/Goods/Detail/OptionSection.tsx | 8 +++- src/components/features/Layout/Header.tsx | 2 +- .../Order/OrderForm/GoodsInfo/index.tsx | 40 ++++++++++++++-- .../Order/OrderForm/OrderInfo/index.tsx | 38 +++++++++++++-- .../features/Order/OrderForm/index.test.tsx | 26 ++++++----- .../features/Order/OrderForm/index.tsx | 46 ++++++++++++++++--- src/types/index.ts | 6 ++- 8 files changed, 135 insertions(+), 32 deletions(-) diff --git a/src/api/hooks/useGetProductOptions.ts b/src/api/hooks/useGetProductOptions.ts index 1be861ee0..7941f6ed4 100644 --- a/src/api/hooks/useGetProductOptions.ts +++ b/src/api/hooks/useGetProductOptions.ts @@ -16,6 +16,7 @@ export const getProductOptions = async (params: ProductDetailRequestParams) => { const response = await fetchInstance.get( getProductOptionsPath(params.productId), ); + console.log("options: ", response.data); return response.data; }; diff --git a/src/components/features/Goods/Detail/OptionSection.tsx b/src/components/features/Goods/Detail/OptionSection.tsx index 6f88b9ad7..8753599b2 100644 --- a/src/components/features/Goods/Detail/OptionSection.tsx +++ b/src/components/features/Goods/Detail/OptionSection.tsx @@ -121,9 +121,13 @@ export const OptionSection = ({ productId }: Props) => { return; } + const selectedOption = options.find(option => Number(counts[option.id]) > 0); + orderHistorySessionStorage.set({ - id: parseInt(productId, 10), - count: totalCount, + productId: parseInt(productId, 10), + optionId: selectedOption?.id ?? 0, + quantity: totalCount, + message: '', }); navigate(RouterPath.order); diff --git a/src/components/features/Layout/Header.tsx b/src/components/features/Layout/Header.tsx index 99c130d69..e5b571181 100644 --- a/src/components/features/Layout/Header.tsx +++ b/src/components/features/Layout/Header.tsx @@ -43,7 +43,7 @@ export const Header = () => {