Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 찜하기 오류 수정 #114

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@
"vite": "^5.0.8",
"vitest": "^1.2.1"
},
"packageManager": "yarn@4.0.2"
"packageManager": "yarn@3.8.1"
}
11 changes: 5 additions & 6 deletions src/apis/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import axios, {
AxiosError,
AxiosResponse,
InternalAxiosRequestConfig,
} from 'axios';

import { ApiResponse } from '@type/apiResponse';
import {
getAccessToken,
renewAccessToken,
renewRefreshToken,
} from '@utils/localStorage/token';
import axios, {
AxiosError,
AxiosResponse,
InternalAxiosRequestConfig,
} from 'axios';

export const api = axios.create({
baseURL: import.meta.env.VITE_BASE_URL,
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/BuyWithLikeButton.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Button } from 'konsta/react';

import { HeartButton } from '@components/atoms';
import { useGetAccountInfo } from '@hooks/apis/account';
import { useBuyButtonStore } from '@stores/buyButtonStore';
import { useBottomSheetStore } from '@stores/layerStore';
import isLogin from '@utils/isLogin';
import { Button } from 'konsta/react';
import { useNavigate } from 'react-router-dom';

type LikeButtonProps = {
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/ImageSlider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ReactNode, useState } from 'react';

import { IndexIndicator } from '@components/atoms';
import { ReactNode, useState } from 'react';
import Slider from 'react-slick';

import '@styles/slick.css';
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/ImageUploadButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { useCallback, useRef } from 'react';

import { SvgIcon } from '@components/common';
import colors from '@constants/colors';
import { usePostImageUpload } from '@hooks/apis/imageUpload';
import { useQueryClient } from '@tanstack/react-query';
import { useCallback, useRef } from 'react';

const ImageUploadButton = () => {
const inputRef = useRef<HTMLInputElement | null>(null);
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/ListPoint.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Block, Button } from 'konsta/react';

import { SvgIcon } from '@components/common';
import colors from '@constants/colors';
import koRefundStatus from '@constants/koRefundStatus';
import { PointHistory } from '@models/point/entity/point';
import { KoRefundStatus } from '@type/refundStatus';
import { getDataInYYYYMMDDSplitedByDot, getPointText } from '@utils/formatData';
import { Block, Button } from 'konsta/react';
import { useNavigate } from 'react-router-dom';

type ListPointProps = PointHistory;
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { ReactNode } from 'react';

import {
Dialog,
DialogContent,
Expand All @@ -10,6 +8,7 @@ import {
DialogFooter,
} from '@components/ui/dialog';
import { useModalStore } from '@stores/layerStore';
import { ReactNode } from 'react';

export type ModalProps = {
title: string;
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/SearchTextField.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { useState, KeyboardEvent, useEffect } from 'react';

import { IconButton } from '@components/atoms';
import { SvgIcon } from '@components/common';
import colors from '@constants/colors';
import { useSearchHistoryStore } from '@stores/searchHistoryStore';
import { useState, KeyboardEvent, useEffect } from 'react';
import { useLocation, useNavigate, useSearchParams } from 'react-router-dom';

type SearchTextFieldProps = {
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/ToastMessageLikeOrDelete.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Button } from 'konsta/react';

import { SvgIcon } from '@components/common';
import colors from '@constants/colors';
import { Button } from 'konsta/react';
import toast from 'react-hot-toast';
import { useNavigate } from 'react-router-dom';

Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/button/DefaultButton.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Button } from 'konsta/react';

import { SvgIcon } from '@components/common';
import dynamicBorderColor from '@constants/dynamicTailwind/dynamicBorderColor';
import dynamicKColor from '@constants/dynamicTailwind/dynamicKColor';
import dynamicTextColor from '@constants/dynamicTailwind/dynamicTextColor';
import ColorKey from '@type/colorKey';
import svgIcon from '@type/svgIcon';
import { Button } from 'konsta/react';

type DefaultButtonProps = {
icon?: svgIcon;
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/button/HeartButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { useEffect, useState } from 'react';

import { IconButton, ToastMessageLikeOrDelete } from '@components/index';
import { useDeleteWishItem, usePostWishItem } from '@hooks/apis/wishList';
import { useBottomSheetStore } from '@stores/layerStore';
import isLogin from '@utils/isLogin';
import { useEffect, useState } from 'react';
import toast from 'react-hot-toast';

type HeartButtonProps = {
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/button/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Button } from 'konsta/react';

import { SvgIcon } from '@components/common';
import svgIcon from '@type/svgIcon';
import { Button } from 'konsta/react';

type IconButtonProps = {
className?: string;
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/button/RequestLeaveModalButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { MouseEvent } from 'react';

import { DefaultButton } from '@components/atoms';
import { useModalStore } from '@stores/layerStore';
import { MouseEvent } from 'react';
import { useNavigate } from 'react-router-dom';

const RequestLeaveModalButton = () => {
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/card/ImageWithCheck.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useState } from 'react';

import { BackdropFilter, IconButton } from '@components/atoms';
import colors from '@constants/colors';
import { useWishListEditStore } from '@stores/wishListStore';
import { useState } from 'react';

type ImageWithCheckProps = {
src: string;
Expand Down
17 changes: 8 additions & 9 deletions src/components/atoms/form/TextField.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
import { Button } from 'konsta/react';
import {
useState,
ReactNode,
ChangeEvent,
KeyboardEvent,
MouseEvent,
} from 'react';

import { DefaultButton } from '@components/atoms';
import { zodResolver } from '@hookform/resolvers/zod';
import FixedBottomLayout from '@layouts/FixedBottomLayout';
Expand All @@ -15,6 +6,14 @@ import { useAccountInfoStore } from '@stores/formInfoStore';
import { useBottomSheetStore } from '@stores/layerStore';
import { FormName, FormType, SchemaType } from '@type/form';
import { getOriginalPoint, getPointText } from '@utils/formatData';
import { Button } from 'konsta/react';
import {
useState,
ReactNode,
ChangeEvent,
KeyboardEvent,
MouseEvent,
} from 'react';
import {
useForm,
SubmitHandler,
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/myPage/BankButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Button } from 'konsta/react';

import { SvgIcon } from '@components/common';
import { IconId } from '@type/svgIcon';
import { Button } from 'konsta/react';

type BankButtonProps = {
iconId: IconId;
Expand Down
3 changes: 1 addition & 2 deletions src/components/atoms/myPage/CategoryButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Button } from 'konsta/react';

import { SvgIcon } from '@components/common';
import colors from '@constants/colors';
import { IconId } from '@type/svgIcon';
import { Button } from 'konsta/react';

type CategoryButtonProps = {
iconId?: IconId;
Expand Down
5 changes: 2 additions & 3 deletions src/components/common/ProvidersTree.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { KonstaProvider, Preloader } from 'konsta/react';
import { Suspense } from 'react';

import Error from '@pages/Error';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ComponentWithProps } from '@type/providerTree';
import { buildProvidersTree } from '@utils/buildProvidersTree';
import { KonstaProvider, Preloader } from 'konsta/react';
import { Suspense } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { BrowserRouter } from 'react-router-dom';

Expand Down
3 changes: 1 addition & 2 deletions src/components/molecules/point/PointHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useEffect } from 'react';

import {
GroupOrderTextPoint,
RequestVerificationButton,
} from '@components/atoms';
import { useGetCurrentPoint } from '@hooks/apis/point';
import { setHeldPoint } from '@utils/localStorage/point';
import { useEffect } from 'react';

const PointHeader = () => {
const { data: totalPoint } = useGetCurrentPoint();
Expand Down
3 changes: 1 addition & 2 deletions src/components/molecules/search/PreSearchHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button } from 'konsta/react';

import { useSearchHistoryStore } from '@stores/searchHistoryStore';
import { Button } from 'konsta/react';

const PreSearchHeader = () => {
const handleDeleteSearchHistory = useSearchHistoryStore(
Expand Down
3 changes: 1 addition & 2 deletions src/components/molecules/wishList/DefaultWishListHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button } from 'konsta/react';

import { useWishListStore } from '@stores/wishListStore';
import { Button } from 'konsta/react';

const DefaultWishListHeader = () => {
const setWishListStatus = useWishListStore(state => state.setWishListStatus);
Expand Down
3 changes: 1 addition & 2 deletions src/components/molecules/wishList/EditWishListHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Button } from 'konsta/react';

import { useWishListEditStore, useWishListStore } from '@stores/wishListStore';
import { Button } from 'konsta/react';

const EditWishListHeader = () => {
const setWishListStatus = useWishListStore(state => state.setWishListStatus);
Expand Down
4 changes: 2 additions & 2 deletions src/components/organisms/ProductCardList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ const ProductCardList = ({
}: ProductCardListProps) => {
return (
<div className={`grid gap-4 ${classNameOfGridCols[gridCols]}`}>
{productList.map(({ thumbnailUrl, id, ...product }, index) => (
{productList.map(({ thumbnailUrl, id, ...product }) => (
<ProductCard
thumbnailUrl={thumbnailUrl}
size={size}
type={type}
key={`ProductCard#${index}`}
key={`ProductCard#${id}`}
id={id}
{...product}
/>
Expand Down
3 changes: 1 addition & 2 deletions src/components/organisms/form/AccountForm.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useEffect } from 'react';

import { Form } from '@components/atoms';
import { useAccountInfoStore } from '@stores/formInfoStore';
import { FormType, accountSchema } from '@type/form';
import { useEffect } from 'react';

type AccountFormProps = {
disabled?: boolean;
Expand Down
3 changes: 1 addition & 2 deletions src/components/templates/search/PostSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Preloader } from 'konsta/react';

import { SearchTextField } from '@components/atoms';
import { PostSearchHeader } from '@components/molecules';
import { ProductCardList } from '@components/organisms';
import { useSearch } from '@hooks/apis/search';
import useIntersection from '@hooks/infiniteScroll';
import { SearchQuery } from '@type/searchQuery';
import { Preloader } from 'konsta/react';

type PostSearchProps = {
searchQuery: SearchQuery;
Expand Down
3 changes: 1 addition & 2 deletions src/components/templates/withdrawal/ProgressWithdrawal.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useEffect } from 'react';

import { Form, RequestLeaveModalButton } from '@components/atoms';
import { usePostPointWithdraw } from '@hooks/apis/point';
import { useAccountInfoStore } from '@stores/formInfoStore';
import { useQueryClient } from '@tanstack/react-query';
import { FormType, pointSchema } from '@type/form';
import { useEffect } from 'react';
import { useNavigate } from 'react-router-dom';

const ProgressWithdrawal = () => {
Expand Down
3 changes: 1 addition & 2 deletions src/components/ui/dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import * as React from 'react';

import * as DialogPrimitive from '@radix-ui/react-dialog';
import { cn } from '@utils/shadcn';
import { X } from 'lucide-react';
import * as React from 'react';

const Dialog = DialogPrimitive.Root;

Expand Down
3 changes: 1 addition & 2 deletions src/components/ui/drawer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';

import { cn } from '@utils/shadcn';
import * as React from 'react';
import { Drawer as DrawerPrimitive } from 'vaul';

const Drawer = ({
Expand Down
3 changes: 1 addition & 2 deletions src/constants/statusTag.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ReactNode } from 'react';

import { ApprovedTag, NotApprovedTag, ProgressTag } from '@components/atoms';
import { RefundStatus } from '@type/refundStatus';
import { ReactNode } from 'react';

type StatusValueType = {
[K in RefundStatus]: ReactNode;
Expand Down
3 changes: 1 addition & 2 deletions src/layouts/PageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ReactNode } from 'react';

import { Header } from '@components/organisms';
import { LeftHeaderProps } from '@components/organisms/Header';
import { ReactNode } from 'react';

export type PageLayoutDefaultProps = {
children: ReactNode;
Expand Down
3 changes: 1 addition & 2 deletions src/pages/Category.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { Preloader } from 'konsta/react';

import { SearchTextField } from '@components/atoms';
import { SvgIcon } from '@components/common';
import { ProductCardList } from '@components/organisms';
Expand All @@ -8,6 +6,7 @@ import colors from '@constants/colors';
import { useGetProductSimpleList } from '@hooks/apis/product';
import useIntersection from '@hooks/infiniteScroll';
import PageLayout from '@layouts/PageLayout';
import { Preloader } from 'konsta/react';
import { useParams } from 'react-router-dom';

type CategoryParams = {
Expand Down
3 changes: 1 addition & 2 deletions src/pages/Error.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useEffect, useRef } from 'react';

import { DefaultButton, SvgIcon } from '@components/index';
import ClearLayout from '@layouts/ClearLayout';
import FixedBottomLayout from '@layouts/FixedBottomLayout';
import { useEffect, useRef } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';

type FallbackProps = {
Expand Down
5 changes: 2 additions & 3 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import { Preloader } from 'konsta/react';
import { useEffect } from 'react';

import { SearchTextField } from '@components/atoms';
import { CategoryButtonList } from '@components/molecules';
import {
Expand All @@ -12,6 +9,8 @@ import { useGetProductSimpleList } from '@hooks/apis/product';
import useIntersection from '@hooks/infiniteScroll';
import PageLayout from '@layouts/PageLayout';
import { setAccessToken, setRefreshToken } from '@utils/localStorage/token';
import { Preloader } from 'konsta/react';
import { useEffect } from 'react';
import { useSearchParams } from 'react-router-dom';

const Home = () => {
Expand Down
3 changes: 1 addition & 2 deletions src/pages/ImageUpload.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Preloader } from 'konsta/react';

import { ImageUploadButton } from '@components/atoms';
import { ImageContainer } from '@components/molecules';
import { useGetImageUploadSimpleList } from '@hooks/apis/imageUpload';
import useIntersection from '@hooks/infiniteScroll';
import PageLayout from '@layouts/PageLayout';
import { Preloader } from 'konsta/react';
import { useNavigate } from 'react-router-dom';

const ImageUpload = () => {
Expand Down
Loading
Loading