Skip to content

Commit

Permalink
fix: import 순서 수정 및 안쓰는 파일 삭제 #221
Browse files Browse the repository at this point in the history
  • Loading branch information
1119wj committed Dec 5, 2024
1 parent 38d811d commit d223ea2
Show file tree
Hide file tree
Showing 58 changed files with 182 additions and 391 deletions.
3 changes: 2 additions & 1 deletion frontend/src/api/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { axiosInstance } from '@/api/axiosInstance';

import { END_POINTS } from '@/constants/api';
import { axiosInstance } from '../axiosInstance';
import { User } from '@/types';

type LogInResponse = {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/api/axiosInstance.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import axios from 'axios';

import { AXIOS_BASE_URL, NETWORK } from '@/constants/api';

import {
checkAndSetToken,
handleAPIError,
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/api/course/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { axiosInstance } from '@/api/axiosInstance';

import { BaseMap, Course, CourseList } from '@/types';
import { axiosInstance } from '../axiosInstance';
import { END_POINTS } from '@/constants/api';

type CourseResponse = {
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/api/image/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { axiosInstance } from '../axiosInstance';
import { PreSignedURLResponse } from '../../types';
import { axiosInstance } from '@/api/axiosInstance';

import { PreSignedURLResponse } from '@/types';
import { END_POINTS, IMAGE_EXTENSIONS } from '@/constants/api';
import { IMAGE_HEIGHT, IMAGE_WIDTH, THREE_MB } from '../../constants/api';
import { IMAGE_HEIGHT, IMAGE_WIDTH, THREE_MB } from '@/constants/api';

const generatePreSignedPost = async (dirName: string, extension: string) => {
const { data } = await axiosInstance.post<PreSignedURLResponse>(
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/api/interceptors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { AxiosError, InternalAxiosRequestConfig } from 'axios';

import { postTokenRefresh } from './auth';
import { axiosInstance } from './axiosInstance';

import { USER_ERROR_MESSAGE } from '@/constants/api';
import { CustomError } from './CustomError';

Expand Down Expand Up @@ -50,7 +52,6 @@ export const handleTokenError = async (
}

if (data.code === 'E500') {
console.log('유효하지 않은 토큰입니다.');
localStorage.removeItem('ACCESS_TOKEN_KEY');
throw new Error('로그인이 필요합니다.');
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/api/map/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { axiosInstance } from '@/api/axiosInstance';

import { BaseMap, MapList, Map } from '@/types';
import { axiosInstance } from '../axiosInstance';
import { END_POINTS } from '@/constants/api';

type MapResponse = {
Expand Down Expand Up @@ -61,7 +62,6 @@ export const editMapInfo = async ({
thumbnailUrl: string;
mapId: number;
}) => {
console.log(thumbnailUrl, 'thumbnailUrl API');
const { data } = await axiosInstance.patch<EditInfoResponse>(
END_POINTS.EDIT_MAP_INFO(mapId),
{
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/api/place/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { axiosInstance } from '@/api/axiosInstance';

import { END_POINTS } from '@/constants/api';
import { CoursePlace, CustomPlace, Place, PlaceWithOrder } from '@/types';
import { axiosInstance } from '../axiosInstance';

export const getPlace = async (queryString: string, pageParam: number) => {
const { data } = await axiosInstance.get<Place[]>(END_POINTS.PLACE, {
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/Authorize.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { ROUTES } from '@/constants/routes';
import { useStore } from '@/store/useStore';
import { useEffect } from 'react';
import { useNavigate } from 'react-router-dom';

import { ROUTES } from '@/constants/routes';
import { useStore } from '@/store/useStore';

type AuthorizeProps = {
children: React.ReactNode;
id: number;
Expand Down
9 changes: 6 additions & 3 deletions frontend/src/components/Form/CreateBaseMapForm.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import FormWrapper from './FormWrapper';
import BaseWrapper from '../common/BaseWrapper';
import { useNavigate } from 'react-router-dom';

import BaseWrapper from '@/components/common/BaseWrapper';
import FormWrapper from './FormWrapper';

import { useAddMapMutation } from '@/hooks/api/useAddMapMutation';
import { useMapForm } from '@/hooks/useMapForm';
import { useStore } from '@/store/useStore';

import { CreateMapType } from '@/types';
import { ROUTES } from '@/constants/routes';
import { useStore } from '@/store/useStore';

const CreateBaseMapForm = () => {
const { mapInfo, updateMapInfo, isMapInfoValid } = useMapForm();
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/Form/EditCourseForm.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from 'react';
import BaseWrapper from '../common/BaseWrapper';
import { useNavigate } from 'react-router-dom';

import BaseWrapper from '@/components/common/BaseWrapper';
import FormWrapper from './FormWrapper';
import { BaseMap, Course } from '@/types';

import { useEditCourseMutation } from '@/hooks/api/useEditCourseMutation';
import { useMapForm } from '@/hooks/useMapForm';

import { useNavigate } from 'react-router-dom';
import { useStore } from '@/store/useStore';
import { BaseMap, Course } from '@/types';

type EditCourseFormProps = {
courseData: Course;
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/Form/EditMapForm.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from 'react';
import BaseWrapper from '../common/BaseWrapper';
import { useNavigate } from 'react-router-dom';

import BaseWrapper from '@/components/common/BaseWrapper';
import FormWrapper from './FormWrapper';
import { BaseMap, Map } from '@/types';

import { useEditMapMutation } from '@/hooks/api/useEditMapMutation';
import { useMapForm } from '@/hooks/useMapForm';

import { useNavigate } from 'react-router-dom';
import { useStore } from '@/store/useStore';
import { BaseMap, Map } from '@/types';

type EditMapFormProps = {
mapData: Map;
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/components/Form/FormWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { BaseMap, CreateMapType } from '@/types';
import ImageUploader from './ImageUploader';
import TextInputArea from '../common/TextInputArea';
import VisibilitySelector from './VisibilitySelector';
import Box from '../common/Box';
import DashBoardHeader from '../common/DashBoardHeader';

import Box from '@/components/common/Box';
import TextInputArea from '@/components/common/TextInputArea';
import DashBoardHeader from '@/components/common/DashBoardHeader';

import { BaseMap, CreateMapType } from '@/types';

type FormWrapperProps = {
header: string;
Expand Down
6 changes: 0 additions & 6 deletions frontend/src/components/Form/ImageIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import React from 'react';

/**
* 이미지 업로드에 쓰이는 아이콘 컴포넌트입니다.
*/

const ImageIcon = () => {
return (
<svg
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/Form/ImageUploader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { useState, useEffect, useRef } from 'react';

import ImageIcon from '@/components/Form/ImageIcon';

import { uploadImage } from '@/api/image/index';
import { BaseMap } from '@/types';

Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/Form/VisibilitySelector.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Option from '@/components/common/Option';

import { VISIBILITY_TEXTS } from '@/constants/map';

type VisibilitySelectorProps = {
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/ImageSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React, { useState, useEffect } from 'react';
import { useInView } from 'react-intersection-observer';

type ImageWithSkeletonProps = {
src: string;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useLayoutEffect } from 'react';

import { useUserInfoQuery } from '@/hooks/api/useUserInfoQuery';
import { useStore } from '@/store/useStore';
import { useLayoutEffect } from 'react';

type LoginProps = {
children: React.ReactNode;
Expand Down
10 changes: 6 additions & 4 deletions frontend/src/components/Map/CourseDetailBoard.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { useEffect, useMemo, useState } from 'react';

import BaseWrapper from '@/components/common/BaseWrapper';
import Box from '@/components/common/Box';
import DashBoardHeader from '@/components/common/DashBoardHeader';
import { Course, Map } from '@/types';
import PlaceItem from '@/components/Place/PlaceItem';
import { useEffect, useMemo, useState } from 'react';
import PlaceDetailPanel from '@/components/Place/PlaceDetailPanel';
import { useStore } from '@/store/useStore';
import SideContainer from '@/components/common/SideContainer';
import Marker from '@/components/Marker/Marker';
import Polyline from '@/components/Marker/Polyline';
import DeleteMapButton from './DeleteMapButton';
import EditMapButton from './EditMapButton';
import Polyline from '../Marker/Polyline';

import { useStore } from '@/store/useStore';
import { Course } from '@/types';

type MapDetailBoardProps = {
courseData: Course;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Map/DeleteMapButton.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useNavigate } from 'react-router-dom';

import useDeleteMapMutation from '@/hooks/api/useDeleteMapMutation';
import { useStore } from '@/store/useStore';
import { CreateMapType } from '@/types';
import { useNavigate } from 'react-router-dom';

/**todo : 삭제 모달 구현*/

Expand Down
10 changes: 6 additions & 4 deletions frontend/src/components/Map/MapDetailBoard.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { useEffect, useMemo, useState } from 'react';

import BaseWrapper from '@/components/common/BaseWrapper';
import Box from '@/components/common/Box';
import DashBoardHeader from '@/components/common/DashBoardHeader';
import { Map } from '@/types';
import PlaceItem from '@/components/Place/PlaceItem';
import { useEffect, useMemo, useState } from 'react';
import PlaceDetailPanel from '@/components/Place/PlaceDetailPanel';
import { useStore } from '@/store/useStore';
import SideContainer from '@/components/common/SideContainer';
import ListItemThumbnail from '@/components/common/List/ListItemThumbnail';
import Marker from '@/components/Marker/Marker';
import DeleteMapButton from './DeleteMapButton';
import EditMapButton from './EditMapButton';
import ListItemThumbnail from '@/components/common/List/ListItemThumbnail';

import { useStore } from '@/store/useStore';
import { Map } from '@/types';

type MapDetailBoardProps = {
mapData: Map;
Expand Down
123 changes: 0 additions & 123 deletions frontend/src/components/PinIcon.tsx

This file was deleted.

3 changes: 2 additions & 1 deletion frontend/src/components/Place/AddPlaceButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Box from '@/components/common/Box';

import { useStore } from '@/store/useStore';
import Box from '../common/Box';

type AddPlaceButtonProps = {
onClick: () => void;
Expand Down
Loading

0 comments on commit d223ea2

Please sign in to comment.