From b4157c1d36ea44f8a635c90f642c778f8f0ed175 Mon Sep 17 00:00:00 2001 From: diwoni <70441308+Diwoni@users.noreply.github.com> Date: Tue, 12 Nov 2024 19:11:30 +0900 Subject: [PATCH 1/8] =?UTF-8?q?Refactor:=20=EB=B3=B4=ED=98=B8=EC=9E=90=20?= =?UTF-8?q?=EA=B0=80=EC=9D=B4=EB=93=9C=EB=9D=BC=EC=9D=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=ED=8F=B4=EB=8D=94=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../guard/guide-line/api/add-guideline.api.ts | 8 +------- .../guide-line/api/modify-guideline.api.ts | 8 +------- .../api/view-senior-all-guideline.api.ts | 18 ++++-------------- .../api/view-specific-guideline.api.ts | 6 +----- .../guide-line/types/guideline.request.ts | 18 ++++++++++++++++++ .../guide-line/types/guideline.response.ts | 6 ++++++ .../guard/guide-line/types/guidelineData.ts | 6 ++++++ src/pages/guard/guide-line/types/index.ts | 3 +++ .../guard/guide-line/ui/GuideLinePage.tsx | 2 +- 9 files changed, 41 insertions(+), 34 deletions(-) create mode 100644 src/pages/guard/guide-line/types/guideline.request.ts create mode 100644 src/pages/guard/guide-line/types/guideline.response.ts create mode 100644 src/pages/guard/guide-line/types/guidelineData.ts create mode 100644 src/pages/guard/guide-line/types/index.ts diff --git a/src/pages/guard/guide-line/api/add-guideline.api.ts b/src/pages/guard/guide-line/api/add-guideline.api.ts index f7e70d57..cb06e7e8 100644 --- a/src/pages/guard/guide-line/api/add-guideline.api.ts +++ b/src/pages/guard/guide-line/api/add-guideline.api.ts @@ -1,12 +1,6 @@ +import { AddGuidelineRequest } from '../types'; import { fetchInstance } from '@/shared/api/instance'; -export type AddGuidelineRequest = { - seniorId: number; - type: string; - title: string; - content: string; -}; - const addGuidelinePath = () => '/api/guardguidelines'; export const addGuidelineQueryKey = () => [addGuidelinePath()]; diff --git a/src/pages/guard/guide-line/api/modify-guideline.api.ts b/src/pages/guard/guide-line/api/modify-guideline.api.ts index 5a5516fe..222a8269 100644 --- a/src/pages/guard/guide-line/api/modify-guideline.api.ts +++ b/src/pages/guard/guide-line/api/modify-guideline.api.ts @@ -1,12 +1,6 @@ +import { ModifyGuidelineRequest } from '../types'; import { fetchInstance } from '@/shared/api/instance'; -export type ModifyGuidelineRequest = { - seniorId: number; - type: string; - title: string; - content: string; -}; - export const modifyGuidelinePath = (guidelineId: number) => `/api/guardguidelines/${guidelineId}`; diff --git a/src/pages/guard/guide-line/api/view-senior-all-guideline.api.ts b/src/pages/guard/guide-line/api/view-senior-all-guideline.api.ts index 2f40c406..cba6641a 100644 --- a/src/pages/guard/guide-line/api/view-senior-all-guideline.api.ts +++ b/src/pages/guard/guide-line/api/view-senior-all-guideline.api.ts @@ -1,19 +1,9 @@ +import { + SeniorAllGuideLineRequest, + SeniorAllGuideLineResponse, +} from '../types'; import { fetchInstance } from '@/shared/api/instance'; -export type SeniorAllGuideLineResponse = SeniorGuideLineData[]; - -export type SeniorGuideLineData = { - id: number; - type: string; - title: string; - content: string; -}; - -export type SeniorAllGuideLineRequest = { - seniorId: number; - guidelineType: string; -}; - // 특정 시니어의 특정 가이드라인 타입(TAXI, DELIVERY)의 가이드라인 조회 const getSeniorAllGuidelinesPath = ( seniorId?: number, diff --git a/src/pages/guard/guide-line/api/view-specific-guideline.api.ts b/src/pages/guard/guide-line/api/view-specific-guideline.api.ts index 11d200e0..f29e1ca7 100644 --- a/src/pages/guard/guide-line/api/view-specific-guideline.api.ts +++ b/src/pages/guard/guide-line/api/view-specific-guideline.api.ts @@ -1,10 +1,6 @@ +import { ViewSpecificGuidelineResponse } from '../types'; import { fetchInstance } from '@/shared/api/instance'; -export type ViewSpecificGuidelineResponse = { - title: string; - content: string; -}[]; - const getViewSpecificGuidelinePath = (guidelineId: number) => `/api/guideline/${guidelineId}`; diff --git a/src/pages/guard/guide-line/types/guideline.request.ts b/src/pages/guard/guide-line/types/guideline.request.ts new file mode 100644 index 00000000..2945d981 --- /dev/null +++ b/src/pages/guard/guide-line/types/guideline.request.ts @@ -0,0 +1,18 @@ +export type AddGuidelineRequest = { + seniorId: number; + type: string; + title: string; + content: string; +}; + +export type ModifyGuidelineRequest = { + seniorId: number; + type: string; + title: string; + content: string; +}; + +export type SeniorAllGuideLineRequest = { + seniorId: number; + guidelineType: string; +}; diff --git a/src/pages/guard/guide-line/types/guideline.response.ts b/src/pages/guard/guide-line/types/guideline.response.ts new file mode 100644 index 00000000..5c1582a3 --- /dev/null +++ b/src/pages/guard/guide-line/types/guideline.response.ts @@ -0,0 +1,6 @@ +export type SeniorAllGuideLineResponse = SeniorGuideLineData[]; + +export type ViewSpecificGuidelineResponse = { + title: string; + content: string; +}[]; diff --git a/src/pages/guard/guide-line/types/guidelineData.ts b/src/pages/guard/guide-line/types/guidelineData.ts new file mode 100644 index 00000000..04d78078 --- /dev/null +++ b/src/pages/guard/guide-line/types/guidelineData.ts @@ -0,0 +1,6 @@ +export type SeniorGuideLineData = { + id: number; + type: string; + title: string; + content: string; +}; diff --git a/src/pages/guard/guide-line/types/index.ts b/src/pages/guard/guide-line/types/index.ts new file mode 100644 index 00000000..53be22d8 --- /dev/null +++ b/src/pages/guard/guide-line/types/index.ts @@ -0,0 +1,3 @@ +export * from './guideline.request'; +export * from './guideline.response'; +export * from './guidelineData'; diff --git a/src/pages/guard/guide-line/ui/GuideLinePage.tsx b/src/pages/guard/guide-line/ui/GuideLinePage.tsx index 60016a0a..460731d5 100644 --- a/src/pages/guard/guide-line/ui/GuideLinePage.tsx +++ b/src/pages/guard/guide-line/ui/GuideLinePage.tsx @@ -1,8 +1,8 @@ import { useParams } from 'react-router-dom'; -import { SeniorGuideLineData } from '../api/view-senior-all-guideline.api'; import { GuideLineInfo, GuidelineRegisterBox } from '../components'; import { useGetSeniorAllGuidelines } from '../hooks'; +import { SeniorGuideLineData } from '../types'; import { PageLayout } from '@/shared'; import { Box, Flex, Text } from '@chakra-ui/react'; From e76ab3ece987b55e1afab91f78f240096a1d91f7 Mon Sep 17 00:00:00 2001 From: diwoni <70441308+Diwoni@users.noreply.github.com> Date: Tue, 12 Nov 2024 19:29:07 +0900 Subject: [PATCH 2/8] =?UTF-8?q?Refactor:=20=EB=B3=B4=ED=98=B8=EC=9E=90=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=93=A4=20types=20=20=ED=8F=B4?= =?UTF-8?q?=EB=8D=94=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/guard/guide-line/index.ts | 1 + .../guard/mypage/api/all-senior-info.api.ts | 2 +- .../guard/mypage/api/guard-information.api.ts | 2 +- src/pages/guard/mypage/api/index.ts | 2 -- src/pages/guard/mypage/api/types/index.ts | 9 ------- src/pages/guard/mypage/index.ts | 1 + .../types/all-senior-info.response.ts | 0 .../types/guard-infomation.response.ts | 5 ---- .../mypage/types/guard-information.request.ts | 4 +++ src/pages/guard/mypage/types/index.ts | 3 +++ src/pages/guard/register/api/index.ts | 2 -- .../guard/register/api/senior-info.api.ts | 2 +- src/pages/guard/register/api/types/index.ts | 1 - .../components/senior-info/SeniorInfo.tsx | 7 +---- .../senior-register-box/SeniorFormField.tsx | 2 +- .../senior-register-box/SeniorRegisterBox.tsx | 2 +- .../guard/register/hooks/useAddSeniorInfo.ts | 2 +- .../guard/register/hooks/useEditSeniorInfo.ts | 2 +- .../guard/register/hooks/useSeniorInfo.ts | 2 +- src/pages/guard/register/types/index.ts | 2 ++ src/pages/guard/register/types/senior-info.ts | 5 ++++ .../senior-register.request.ts} | 2 +- .../guard/register/ui/SeniorRegisterPage.tsx | 3 ++- src/pages/guard/review/api/index.ts | 1 - src/pages/guard/review/api/review.api.ts | 2 +- src/pages/guard/review/hooks/usePostReview.ts | 3 ++- src/pages/guard/review/hooks/useReview.ts | 2 +- .../guard/review/{api => }/types/index.ts | 0 .../review/{api => }/types/review.request.ts | 0 .../api/get-callback-history.api.ts | 27 +++---------------- .../api/get-hello-history.api.ts | 10 +------ .../hooks/useGetCallbackHistory.ts | 5 ++-- .../hooks/useGetHelloHistoryList.ts | 2 +- .../hooks/useHelloServiceHistory.ts | 3 ++- src/pages/guard/service-history/index.ts | 1 + .../service-history/types/history.request.ts | 4 +++ .../service-history/types/history.response.ts | 14 ++++++++++ .../guard/service-history/types/history.ts | 13 +++++++++ .../guard/service-history/types/index.ts | 9 +++---- .../service-history/ui/ServiceHistoryPage.tsx | 2 +- 40 files changed, 78 insertions(+), 83 deletions(-) delete mode 100644 src/pages/guard/mypage/api/types/index.ts rename src/pages/guard/mypage/{api => }/types/all-senior-info.response.ts (100%) rename src/pages/guard/mypage/{api => }/types/guard-infomation.response.ts (54%) create mode 100644 src/pages/guard/mypage/types/guard-information.request.ts create mode 100644 src/pages/guard/mypage/types/index.ts delete mode 100644 src/pages/guard/register/api/types/index.ts create mode 100644 src/pages/guard/register/types/index.ts create mode 100644 src/pages/guard/register/types/senior-info.ts rename src/pages/guard/register/{api/types/senior-register.type.ts => types/senior-register.request.ts} (58%) rename src/pages/guard/review/{api => }/types/index.ts (100%) rename src/pages/guard/review/{api => }/types/review.request.ts (100%) create mode 100644 src/pages/guard/service-history/types/history.request.ts create mode 100644 src/pages/guard/service-history/types/history.response.ts create mode 100644 src/pages/guard/service-history/types/history.ts diff --git a/src/pages/guard/guide-line/index.ts b/src/pages/guard/guide-line/index.ts index 5a4e712e..bf03cca1 100644 --- a/src/pages/guard/guide-line/index.ts +++ b/src/pages/guard/guide-line/index.ts @@ -4,3 +4,4 @@ export * from './api'; export * from './components'; export * from './data'; export * from './hooks'; +export * from './types'; diff --git a/src/pages/guard/mypage/api/all-senior-info.api.ts b/src/pages/guard/mypage/api/all-senior-info.api.ts index 9e19ffc0..aea1dc97 100644 --- a/src/pages/guard/mypage/api/all-senior-info.api.ts +++ b/src/pages/guard/mypage/api/all-senior-info.api.ts @@ -1,4 +1,4 @@ -import { AllSeniorInfoResponse } from './types'; +import { AllSeniorInfoResponse } from '../types'; import { fetchInstance } from '@/shared/api/instance'; export const allSeniorInfoPath = () => `/api/guards/senior`; diff --git a/src/pages/guard/mypage/api/guard-information.api.ts b/src/pages/guard/mypage/api/guard-information.api.ts index a5f3e9c1..dff2bc1e 100644 --- a/src/pages/guard/mypage/api/guard-information.api.ts +++ b/src/pages/guard/mypage/api/guard-information.api.ts @@ -1,4 +1,4 @@ -import { GuardInformationResponse, GuardInformationRequest } from './types'; +import { GuardInformationResponse, GuardInformationRequest } from '../types'; import { fetchInstance } from '@/shared/api/instance'; export const guardInformationPath = () => '/api/guards'; diff --git a/src/pages/guard/mypage/api/index.ts b/src/pages/guard/mypage/api/index.ts index e32af646..c7ba9826 100644 --- a/src/pages/guard/mypage/api/index.ts +++ b/src/pages/guard/mypage/api/index.ts @@ -3,5 +3,3 @@ export { modifyGuardInformation, } from './guard-information.api'; export { getAllSeniorInfo } from './all-senior-info.api'; - -export * from './types'; diff --git a/src/pages/guard/mypage/api/types/index.ts b/src/pages/guard/mypage/api/types/index.ts deleted file mode 100644 index 089291dd..00000000 --- a/src/pages/guard/mypage/api/types/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type { - AllSeniorInfo, - AllSeniorInfoResponse, -} from './all-senior-info.response'; - -export type { - GuardInformationResponse, - GuardInformationRequest, -} from './guard-infomation.response'; diff --git a/src/pages/guard/mypage/index.ts b/src/pages/guard/mypage/index.ts index 4ff79b00..916e1eb5 100644 --- a/src/pages/guard/mypage/index.ts +++ b/src/pages/guard/mypage/index.ts @@ -2,3 +2,4 @@ export * from './ui'; export * from './components'; export * from './api'; export * from './hooks'; +export * from './types'; diff --git a/src/pages/guard/mypage/api/types/all-senior-info.response.ts b/src/pages/guard/mypage/types/all-senior-info.response.ts similarity index 100% rename from src/pages/guard/mypage/api/types/all-senior-info.response.ts rename to src/pages/guard/mypage/types/all-senior-info.response.ts diff --git a/src/pages/guard/mypage/api/types/guard-infomation.response.ts b/src/pages/guard/mypage/types/guard-infomation.response.ts similarity index 54% rename from src/pages/guard/mypage/api/types/guard-infomation.response.ts rename to src/pages/guard/mypage/types/guard-infomation.response.ts index 5ff504fb..6275455a 100644 --- a/src/pages/guard/mypage/api/types/guard-infomation.response.ts +++ b/src/pages/guard/mypage/types/guard-infomation.response.ts @@ -3,8 +3,3 @@ export type GuardInformationResponse = { email: string; phoneNumber: string; }; - -export type GuardInformationRequest = { - name: string; - phoneNumber: string; -}; diff --git a/src/pages/guard/mypage/types/guard-information.request.ts b/src/pages/guard/mypage/types/guard-information.request.ts new file mode 100644 index 00000000..84515323 --- /dev/null +++ b/src/pages/guard/mypage/types/guard-information.request.ts @@ -0,0 +1,4 @@ +export type GuardInformationRequest = { + name: string; + phoneNumber: string; +}; diff --git a/src/pages/guard/mypage/types/index.ts b/src/pages/guard/mypage/types/index.ts new file mode 100644 index 00000000..f1d785a7 --- /dev/null +++ b/src/pages/guard/mypage/types/index.ts @@ -0,0 +1,3 @@ +export * from './all-senior-info.response'; +export * from './guard-infomation.response'; +export * from './guard-information.request'; diff --git a/src/pages/guard/register/api/index.ts b/src/pages/guard/register/api/index.ts index ac32553a..7ad2a6f3 100644 --- a/src/pages/guard/register/api/index.ts +++ b/src/pages/guard/register/api/index.ts @@ -3,5 +3,3 @@ export { deleteSeniorInfo, editSeniorInfo, } from './senior-info.api'; - -export * from './types'; diff --git a/src/pages/guard/register/api/senior-info.api.ts b/src/pages/guard/register/api/senior-info.api.ts index c2301e1e..cdb038a3 100644 --- a/src/pages/guard/register/api/senior-info.api.ts +++ b/src/pages/guard/register/api/senior-info.api.ts @@ -1,4 +1,4 @@ -import { SeniorRegisterValues as SeniorRegisterRequest } from './types/senior-register.type'; +import { SeniorRegisterRequest } from '../types'; import { fetchInstance } from '@/shared/api/instance'; export const seniorInfoPath = () => '/api/guards/senior'; diff --git a/src/pages/guard/register/api/types/index.ts b/src/pages/guard/register/api/types/index.ts deleted file mode 100644 index 0c1223b8..00000000 --- a/src/pages/guard/register/api/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export type { SeniorRegisterValues } from './senior-register.type'; diff --git a/src/pages/guard/register/components/senior-info/SeniorInfo.tsx b/src/pages/guard/register/components/senior-info/SeniorInfo.tsx index df31be26..f2b72c04 100644 --- a/src/pages/guard/register/components/senior-info/SeniorInfo.tsx +++ b/src/pages/guard/register/components/senior-info/SeniorInfo.tsx @@ -1,3 +1,4 @@ +import { SeniorInfoType } from '../../types'; import { useDeleteSeniorInfo, useEditSeniorInfo, @@ -8,12 +9,6 @@ import { deleteIcon, editIcon } from '@/shared/assets'; import { Box, Flex, Text, Image, Input } from '@chakra-ui/react'; import styled from '@emotion/styled'; -type SeniorInfoType = { - seniorName: string; - seniorPhoneNumber: string; - seniorId: number; -}; - const SeniorInfo = ({ senior, refetch, diff --git a/src/pages/guard/register/components/senior-register-box/SeniorFormField.tsx b/src/pages/guard/register/components/senior-register-box/SeniorFormField.tsx index 05546e3a..f9db03f4 100644 --- a/src/pages/guard/register/components/senior-register-box/SeniorFormField.tsx +++ b/src/pages/guard/register/components/senior-register-box/SeniorFormField.tsx @@ -1,6 +1,6 @@ import { UseFormRegister } from 'react-hook-form'; -import { SeniorRegisterValues } from '../../api'; +import { SeniorRegisterRequest as SeniorRegisterValues } from '../../types'; import { Box, Input, Text } from '@chakra-ui/react'; import styled from '@emotion/styled'; diff --git a/src/pages/guard/register/components/senior-register-box/SeniorRegisterBox.tsx b/src/pages/guard/register/components/senior-register-box/SeniorRegisterBox.tsx index 61aa4d9a..f4ca7e8f 100644 --- a/src/pages/guard/register/components/senior-register-box/SeniorRegisterBox.tsx +++ b/src/pages/guard/register/components/senior-register-box/SeniorRegisterBox.tsx @@ -1,7 +1,7 @@ import { useForm } from 'react-hook-form'; -import { SeniorRegisterValues } from '../../api'; import { useAddSeniorInfo } from '../../hooks'; +import { SeniorRegisterRequest as SeniorRegisterValues } from '../../types'; import SeniorFormField from './SeniorFormField'; import { parsePhoneNumber, BasicButton } from '@/shared'; import { Flex } from '@chakra-ui/react'; diff --git a/src/pages/guard/register/hooks/useAddSeniorInfo.ts b/src/pages/guard/register/hooks/useAddSeniorInfo.ts index 06bc9917..91d207ae 100644 --- a/src/pages/guard/register/hooks/useAddSeniorInfo.ts +++ b/src/pages/guard/register/hooks/useAddSeniorInfo.ts @@ -1,5 +1,5 @@ import { addSeniorInfo } from '../api'; -import { SeniorRegisterValues as SeniorRegisterRequest } from '../api/types/senior-register.type'; +import { SeniorRegisterRequest } from '../types'; import { useMutation, UseMutationResult } from '@tanstack/react-query'; // 시니어 추가 훅 diff --git a/src/pages/guard/register/hooks/useEditSeniorInfo.ts b/src/pages/guard/register/hooks/useEditSeniorInfo.ts index 81c9516b..05c6fe9d 100644 --- a/src/pages/guard/register/hooks/useEditSeniorInfo.ts +++ b/src/pages/guard/register/hooks/useEditSeniorInfo.ts @@ -1,5 +1,5 @@ import { editSeniorInfo } from '../api'; -import { SeniorRegisterValues as SeniorRegisterRequest } from '../api/types/senior-register.type'; +import { SeniorRegisterRequest } from '../types'; import { useMutation, UseMutationResult } from '@tanstack/react-query'; // 시니어 수정 훅 diff --git a/src/pages/guard/register/hooks/useSeniorInfo.ts b/src/pages/guard/register/hooks/useSeniorInfo.ts index 0afca503..bef96786 100644 --- a/src/pages/guard/register/hooks/useSeniorInfo.ts +++ b/src/pages/guard/register/hooks/useSeniorInfo.ts @@ -1,6 +1,6 @@ import { useState } from 'react'; -import { SeniorRegisterValues as SeniorRegisterRequest } from '../api/types/senior-register.type'; +import { SeniorRegisterRequest } from '../types'; import { formatPhoneNumber, parsePhoneNumber, diff --git a/src/pages/guard/register/types/index.ts b/src/pages/guard/register/types/index.ts new file mode 100644 index 00000000..4a8720d7 --- /dev/null +++ b/src/pages/guard/register/types/index.ts @@ -0,0 +1,2 @@ +export * from './senior-register.request'; +export * from './senior-info'; diff --git a/src/pages/guard/register/types/senior-info.ts b/src/pages/guard/register/types/senior-info.ts new file mode 100644 index 00000000..533662e6 --- /dev/null +++ b/src/pages/guard/register/types/senior-info.ts @@ -0,0 +1,5 @@ +export type SeniorInfoType = { + seniorName: string; + seniorPhoneNumber: string; + seniorId: number; +}; diff --git a/src/pages/guard/register/api/types/senior-register.type.ts b/src/pages/guard/register/types/senior-register.request.ts similarity index 58% rename from src/pages/guard/register/api/types/senior-register.type.ts rename to src/pages/guard/register/types/senior-register.request.ts index e67a5786..298f7f4b 100644 --- a/src/pages/guard/register/api/types/senior-register.type.ts +++ b/src/pages/guard/register/types/senior-register.request.ts @@ -1,4 +1,4 @@ -export type SeniorRegisterValues = { +export type SeniorRegisterRequest = { seniorName: string; seniorPhoneNumber: string; }; diff --git a/src/pages/guard/register/ui/SeniorRegisterPage.tsx b/src/pages/guard/register/ui/SeniorRegisterPage.tsx index b865ade8..5c718394 100644 --- a/src/pages/guard/register/ui/SeniorRegisterPage.tsx +++ b/src/pages/guard/register/ui/SeniorRegisterPage.tsx @@ -1,6 +1,7 @@ import { useGetAllSeniorInfo } from '../../mypage'; import SeniorInfo from '../components/senior-info/SeniorInfo'; import SeniorRegisterBox from '../components/senior-register-box/SeniorRegisterBox'; +import { SeniorInfoType } from '../types'; import { PageLayout } from '@/shared'; import { Box, Flex, Text } from '@chakra-ui/react'; import styled from '@emotion/styled'; @@ -36,7 +37,7 @@ export const SeniorRegisterPage = () => { </Box> <Flex w='full' flexDir='column' gap='var(--space-sm)'> - {seniors?.map((senior) => ( + {seniors?.map((senior: SeniorInfoType) => ( <SeniorInfo key={senior.seniorId} senior={senior} diff --git a/src/pages/guard/review/api/index.ts b/src/pages/guard/review/api/index.ts index 1a2f0a81..4d95de59 100644 --- a/src/pages/guard/review/api/index.ts +++ b/src/pages/guard/review/api/index.ts @@ -1,2 +1 @@ -export * from './types'; export * from './review.api'; diff --git a/src/pages/guard/review/api/review.api.ts b/src/pages/guard/review/api/review.api.ts index ef3a6dfc..585f80f7 100644 --- a/src/pages/guard/review/api/review.api.ts +++ b/src/pages/guard/review/api/review.api.ts @@ -1,4 +1,4 @@ -import { ReviewRequest } from './types'; +import { ReviewRequest } from '../types'; import { fetchInstance } from '@/shared/api/instance'; export const reviewPath = './api/reviews'; diff --git a/src/pages/guard/review/hooks/usePostReview.ts b/src/pages/guard/review/hooks/usePostReview.ts index 929bf5a0..a843220b 100644 --- a/src/pages/guard/review/hooks/usePostReview.ts +++ b/src/pages/guard/review/hooks/usePostReview.ts @@ -1,4 +1,5 @@ -import { postReview, ReviewRequest } from '../api'; +import { postReview } from '../api'; +import { ReviewRequest } from '../types'; import { useMutation, UseMutationResult } from '@tanstack/react-query'; export const usePostReview = (): UseMutationResult< diff --git a/src/pages/guard/review/hooks/useReview.ts b/src/pages/guard/review/hooks/useReview.ts index 2aeb3fd7..bc4baef4 100644 --- a/src/pages/guard/review/hooks/useReview.ts +++ b/src/pages/guard/review/hooks/useReview.ts @@ -1,7 +1,7 @@ import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; -import { ReviewRequest } from '../api'; +import { ReviewRequest } from '../types'; import { UseMutationResult } from '@tanstack/react-query'; type Props = { diff --git a/src/pages/guard/review/api/types/index.ts b/src/pages/guard/review/types/index.ts similarity index 100% rename from src/pages/guard/review/api/types/index.ts rename to src/pages/guard/review/types/index.ts diff --git a/src/pages/guard/review/api/types/review.request.ts b/src/pages/guard/review/types/review.request.ts similarity index 100% rename from src/pages/guard/review/api/types/review.request.ts rename to src/pages/guard/review/types/review.request.ts diff --git a/src/pages/guard/service-history/api/get-callback-history.api.ts b/src/pages/guard/service-history/api/get-callback-history.api.ts index 377f9dc2..e8ed8493 100644 --- a/src/pages/guard/service-history/api/get-callback-history.api.ts +++ b/src/pages/guard/service-history/api/get-callback-history.api.ts @@ -1,28 +1,9 @@ +import { + CallbackHistoryRequestParams, + CallbackHistoryResponse, +} from '../types'; import { fetchInstance } from '@/shared'; -export type CallbackHistoryRequestParams = { - page: number; - size: number; -}; - -export type CallbackHistoryResponse = { - totalElements: number; - totalPages: number; - first: boolean; - last: boolean; - size: number; - content: CallbackHistory[]; - number: number; - empty: boolean; -}; - -export type CallbackHistory = { - callbackId: number; - seniorName: string; - postTime: string; - status: string; -}; - const getCallbackHistoryPath = '/api/callbacks/guard/requested'; export const getCallbackHistoryQueryKey = (page: number) => [ diff --git a/src/pages/guard/service-history/api/get-hello-history.api.ts b/src/pages/guard/service-history/api/get-hello-history.api.ts index e3540390..5c89c289 100644 --- a/src/pages/guard/service-history/api/get-hello-history.api.ts +++ b/src/pages/guard/service-history/api/get-hello-history.api.ts @@ -1,14 +1,6 @@ +import { HelloCallHistory, HelloCallHistoryListResponse } from '../types'; import { fetchInstance } from '@/shared/api/instance'; -export type HelloCallHistory = { - helloCallId: number; - seniorName: string; - days: [string]; - status: string; -}; - -export type HelloCallHistoryListResponse = HelloCallHistory[]; - const getHelloCallHistoryPath = () => '/api/hellocalls/guards/lists'; export const getHelloCallHistoryQueryKey = () => [getHelloCallHistoryPath()]; diff --git a/src/pages/guard/service-history/hooks/useGetCallbackHistory.ts b/src/pages/guard/service-history/hooks/useGetCallbackHistory.ts index 102830e1..c2bb3745 100644 --- a/src/pages/guard/service-history/hooks/useGetCallbackHistory.ts +++ b/src/pages/guard/service-history/hooks/useGetCallbackHistory.ts @@ -1,9 +1,8 @@ +import { getCallbackHistory, getCallbackHistoryQueryKey } from '../api'; import { CallbackHistoryRequestParams, CallbackHistoryResponse, - getCallbackHistory, - getCallbackHistoryQueryKey, -} from '../api'; +} from '../types'; import { useQuery } from '@tanstack/react-query'; export const useGetCallbackHistory = (page: number, size: number) => { diff --git a/src/pages/guard/service-history/hooks/useGetHelloHistoryList.ts b/src/pages/guard/service-history/hooks/useGetHelloHistoryList.ts index 5665db7a..1fdde3cc 100644 --- a/src/pages/guard/service-history/hooks/useGetHelloHistoryList.ts +++ b/src/pages/guard/service-history/hooks/useGetHelloHistoryList.ts @@ -1,8 +1,8 @@ import { getHelloCallHistory, getHelloCallHistoryQueryKey, - HelloCallHistoryListResponse, } from '../api/get-hello-history.api'; +import { HelloCallHistoryListResponse } from '../types'; import { useQuery } from '@tanstack/react-query'; export const useGetHelloHistoryList = () => { diff --git a/src/pages/guard/service-history/hooks/useHelloServiceHistory.ts b/src/pages/guard/service-history/hooks/useHelloServiceHistory.ts index 53598c7a..9cac695d 100644 --- a/src/pages/guard/service-history/hooks/useHelloServiceHistory.ts +++ b/src/pages/guard/service-history/hooks/useHelloServiceHistory.ts @@ -1,6 +1,7 @@ import { useState } from 'react'; -import { HelloCallHistory, useDeleteHelloCall } from '@/pages/guard'; +import { HelloCallHistory } from '../types'; +import { useDeleteHelloCall } from '@/pages/guard'; import { useGetServiceDetail } from '@/pages/sinitto/hello-call-service/api'; type Props = { diff --git a/src/pages/guard/service-history/index.ts b/src/pages/guard/service-history/index.ts index ad3078cd..e9959ccd 100644 --- a/src/pages/guard/service-history/index.ts +++ b/src/pages/guard/service-history/index.ts @@ -5,3 +5,4 @@ export * from './data'; export * from './types'; export * from './api'; export * from './hooks'; +export * from './types'; diff --git a/src/pages/guard/service-history/types/history.request.ts b/src/pages/guard/service-history/types/history.request.ts new file mode 100644 index 00000000..deeded4c --- /dev/null +++ b/src/pages/guard/service-history/types/history.request.ts @@ -0,0 +1,4 @@ +export type CallbackHistoryRequestParams = { + page: number; + size: number; +}; diff --git a/src/pages/guard/service-history/types/history.response.ts b/src/pages/guard/service-history/types/history.response.ts new file mode 100644 index 00000000..ab9a5dac --- /dev/null +++ b/src/pages/guard/service-history/types/history.response.ts @@ -0,0 +1,14 @@ +import { CallbackHistory, HelloCallHistory } from './history'; + +export type CallbackHistoryResponse = { + totalElements: number; + totalPages: number; + first: boolean; + last: boolean; + size: number; + content: CallbackHistory[]; + number: number; + empty: boolean; +}; + +export type HelloCallHistoryListResponse = HelloCallHistory[]; diff --git a/src/pages/guard/service-history/types/history.ts b/src/pages/guard/service-history/types/history.ts new file mode 100644 index 00000000..e774cab9 --- /dev/null +++ b/src/pages/guard/service-history/types/history.ts @@ -0,0 +1,13 @@ +export type CallbackHistory = { + callbackId: number; + seniorName: string; + postTime: string; + status: string; +}; + +export type HelloCallHistory = { + helloCallId: number; + seniorName: string; + days: [string]; + status: string; +}; diff --git a/src/pages/guard/service-history/types/index.ts b/src/pages/guard/service-history/types/index.ts index 0549a27e..24bc1b17 100644 --- a/src/pages/guard/service-history/types/index.ts +++ b/src/pages/guard/service-history/types/index.ts @@ -1,6 +1,3 @@ -// 데이터 타입 : 서비스 이용 내역 (보호자용 페이지 내부) -export type HistoryItem = { - date: string; - name: string; - status: string; -}; +export * from './history'; +export * from './history.request'; +export * from './history.response'; diff --git a/src/pages/guard/service-history/ui/ServiceHistoryPage.tsx b/src/pages/guard/service-history/ui/ServiceHistoryPage.tsx index 1a116714..9f61beb8 100644 --- a/src/pages/guard/service-history/ui/ServiceHistoryPage.tsx +++ b/src/pages/guard/service-history/ui/ServiceHistoryPage.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; -import { CallbackHistory, HelloCallHistory } from '../api'; import { CallbackHistoryText, HelloServiceHistoryText, @@ -8,6 +7,7 @@ import { HelloServiceHistory, } from '../components'; import { useGetCallbackHistory, useGetHelloHistoryList } from '../hooks'; +import { CallbackHistory, HelloCallHistory } from '../types'; import { PageLayout } from '@/shared'; import { Box, Flex } from '@chakra-ui/react'; import styled from '@emotion/styled'; From c566982ae7f99e05fe547ad8b239c185a5440c4c Mon Sep 17 00:00:00 2001 From: diwoni <70441308+Diwoni@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:12:26 +0900 Subject: [PATCH 3/8] =?UTF-8?q?Refactor:=20=EC=8B=9C=EB=8B=88=EB=98=90=20?= =?UTF-8?q?=EB=A7=88=EC=9D=B4=ED=8E=98=EC=9D=B4=EC=A7=80=20types=20?= =?UTF-8?q?=ED=8F=B4=EB=8D=94=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/sinitto/mypage/api/sinitto-information.api.ts | 2 +- src/pages/sinitto/mypage/hooks/useSinittoInfo.ts | 2 +- src/pages/sinitto/mypage/{api => }/types/index.ts | 0 .../mypage/{api => }/types/sinitto-information.request.ts | 0 .../mypage/{api => }/types/sinitto-information.response.ts | 0 5 files changed, 2 insertions(+), 2 deletions(-) rename src/pages/sinitto/mypage/{api => }/types/index.ts (100%) rename src/pages/sinitto/mypage/{api => }/types/sinitto-information.request.ts (100%) rename src/pages/sinitto/mypage/{api => }/types/sinitto-information.response.ts (100%) diff --git a/src/pages/sinitto/mypage/api/sinitto-information.api.ts b/src/pages/sinitto/mypage/api/sinitto-information.api.ts index 3b6b987a..43aeb74d 100644 --- a/src/pages/sinitto/mypage/api/sinitto-information.api.ts +++ b/src/pages/sinitto/mypage/api/sinitto-information.api.ts @@ -2,7 +2,7 @@ import { SinittoBankInfo, SinittoInfoRequest, SinittoInformation, -} from './types'; +} from '../types'; import { fetchInstance } from '@/shared'; const sinittoInformationPath = () => '/api/sinittos'; diff --git a/src/pages/sinitto/mypage/hooks/useSinittoInfo.ts b/src/pages/sinitto/mypage/hooks/useSinittoInfo.ts index 58eb9c4d..00f97887 100644 --- a/src/pages/sinitto/mypage/hooks/useSinittoInfo.ts +++ b/src/pages/sinitto/mypage/hooks/useSinittoInfo.ts @@ -9,7 +9,7 @@ import { SinittoBankInfo, SinittoInfoRequest, SinittoInformation, -} from '../api/types'; +} from '../types'; import { useMutation, UseMutationResult, diff --git a/src/pages/sinitto/mypage/api/types/index.ts b/src/pages/sinitto/mypage/types/index.ts similarity index 100% rename from src/pages/sinitto/mypage/api/types/index.ts rename to src/pages/sinitto/mypage/types/index.ts diff --git a/src/pages/sinitto/mypage/api/types/sinitto-information.request.ts b/src/pages/sinitto/mypage/types/sinitto-information.request.ts similarity index 100% rename from src/pages/sinitto/mypage/api/types/sinitto-information.request.ts rename to src/pages/sinitto/mypage/types/sinitto-information.request.ts diff --git a/src/pages/sinitto/mypage/api/types/sinitto-information.response.ts b/src/pages/sinitto/mypage/types/sinitto-information.response.ts similarity index 100% rename from src/pages/sinitto/mypage/api/types/sinitto-information.response.ts rename to src/pages/sinitto/mypage/types/sinitto-information.response.ts From 28c965187acbac0e85e337d8a00041f7219fbea0 Mon Sep 17 00:00:00 2001 From: diwoni <70441308+Diwoni@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:15:58 +0900 Subject: [PATCH 4/8] =?UTF-8?q?Chore:=20=EC=8B=9C=EB=8B=88=EB=98=90?= =?UTF-8?q?=EC=9D=BC=20=EB=95=8C=20=ED=8F=AC=EC=9D=B8=ED=8A=B8=20=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20=EC=B6=A9=EC=A0=84=20=EC=9A=94=EC=B2=AD=20=ED=85=8D?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/sinitto/mypage/api/index.ts | 2 -- .../features/mypage/point-box/PointBox.tsx | 16 +++++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/pages/sinitto/mypage/api/index.ts b/src/pages/sinitto/mypage/api/index.ts index 973cd765..a117f656 100644 --- a/src/pages/sinitto/mypage/api/index.ts +++ b/src/pages/sinitto/mypage/api/index.ts @@ -5,5 +5,3 @@ export { getSinittoInformation, registerSinittoBankInformation, } from './sinitto-information.api'; - -export * from './types'; diff --git a/src/shared/components/features/mypage/point-box/PointBox.tsx b/src/shared/components/features/mypage/point-box/PointBox.tsx index 2356db9a..842ff677 100644 --- a/src/shared/components/features/mypage/point-box/PointBox.tsx +++ b/src/shared/components/features/mypage/point-box/PointBox.tsx @@ -102,13 +102,15 @@ const PointBox = ({ isSinitto }: Props) => { )} </ButtonContainer> )} - <Text - fontSize='var(--font-size-sm)' - color='var(--color-gray)' - mt='var(--space-sm)' - > - 포인트 충전 요청 후 꼭 카카오톡 나에게 보내기 메세지를 확인해주세요. - </Text> + {isSinitto ? null : ( + <Text + fontSize='var(--font-size-sm)' + color='var(--color-gray)' + mt='var(--space-sm)' + > + 포인트 충전 요청 후 꼭 카카오톡 나에게 보내기 메세지를 확인해주세요. + </Text> + )} </PointBoxLayout> </Flex> ); From e53970b1b97235cfe694f853d5b780511ff39fe7 Mon Sep 17 00:00:00 2001 From: diwoni <70441308+Diwoni@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:21:42 +0900 Subject: [PATCH 5/8] =?UTF-8?q?Fix:=20lint=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/guard/service-history/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/guard/service-history/index.ts b/src/pages/guard/service-history/index.ts index e9959ccd..ad3078cd 100644 --- a/src/pages/guard/service-history/index.ts +++ b/src/pages/guard/service-history/index.ts @@ -5,4 +5,3 @@ export * from './data'; export * from './types'; export * from './api'; export * from './hooks'; -export * from './types'; From 3d08666cbbd447bbdf1619c1a18f54b81dae1db8 Mon Sep 17 00:00:00 2001 From: diwoni <70441308+Diwoni@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:24:40 +0900 Subject: [PATCH 6/8] =?UTF-8?q?Fix:=20lint=20=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../guard/guide-line/hooks/useGetViewSpecificGuideline.ts | 2 +- src/pages/guard/guide-line/hooks/useGuidelineInfo.ts | 2 +- src/pages/guard/guide-line/hooks/useModifyGuideline.ts | 6 ++---- src/pages/guard/guide-line/types/guideline.response.ts | 2 ++ src/pages/guard/mypage/hooks/useGetAllSeniorInfo.ts | 2 +- src/pages/guard/mypage/hooks/useGetGuardInformation.ts | 3 ++- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/pages/guard/guide-line/hooks/useGetViewSpecificGuideline.ts b/src/pages/guard/guide-line/hooks/useGetViewSpecificGuideline.ts index c7ebc26a..61ea23e7 100644 --- a/src/pages/guard/guide-line/hooks/useGetViewSpecificGuideline.ts +++ b/src/pages/guard/guide-line/hooks/useGetViewSpecificGuideline.ts @@ -1,8 +1,8 @@ import { getViewSpecificGuideline, getViewSpecificGuidelineQueryKey, - ViewSpecificGuidelineResponse, } from '../api/view-specific-guideline.api'; +import { ViewSpecificGuidelineResponse } from '../types'; import { useQuery } from '@tanstack/react-query'; export const useGetViewSpecificGuideline = (guidelineId: number) => { diff --git a/src/pages/guard/guide-line/hooks/useGuidelineInfo.ts b/src/pages/guard/guide-line/hooks/useGuidelineInfo.ts index a84657b0..46974f1d 100644 --- a/src/pages/guard/guide-line/hooks/useGuidelineInfo.ts +++ b/src/pages/guard/guide-line/hooks/useGuidelineInfo.ts @@ -1,6 +1,6 @@ import { useState } from 'react'; -import { ModifyGuidelineRequest } from '../api/modify-guideline.api'; +import { ModifyGuidelineRequest } from '../types'; import { UseMutationResult } from '@tanstack/react-query'; type GuidelineInfo = { diff --git a/src/pages/guard/guide-line/hooks/useModifyGuideline.ts b/src/pages/guard/guide-line/hooks/useModifyGuideline.ts index 447c140a..c6bc5a4f 100644 --- a/src/pages/guard/guide-line/hooks/useModifyGuideline.ts +++ b/src/pages/guard/guide-line/hooks/useModifyGuideline.ts @@ -1,7 +1,5 @@ -import { - modifyGuideline, - ModifyGuidelineRequest, -} from '../api/modify-guideline.api'; +import { modifyGuideline } from '../api/modify-guideline.api'; +import { ModifyGuidelineRequest } from '../types'; import { useMutation, UseMutationResult } from '@tanstack/react-query'; export const useModifyGuideline = ( diff --git a/src/pages/guard/guide-line/types/guideline.response.ts b/src/pages/guard/guide-line/types/guideline.response.ts index 5c1582a3..ddfce252 100644 --- a/src/pages/guard/guide-line/types/guideline.response.ts +++ b/src/pages/guard/guide-line/types/guideline.response.ts @@ -1,3 +1,5 @@ +import { SeniorGuideLineData } from './guidelineData'; + export type SeniorAllGuideLineResponse = SeniorGuideLineData[]; export type ViewSpecificGuidelineResponse = { diff --git a/src/pages/guard/mypage/hooks/useGetAllSeniorInfo.ts b/src/pages/guard/mypage/hooks/useGetAllSeniorInfo.ts index fb6f1570..87d5e28b 100644 --- a/src/pages/guard/mypage/hooks/useGetAllSeniorInfo.ts +++ b/src/pages/guard/mypage/hooks/useGetAllSeniorInfo.ts @@ -1,8 +1,8 @@ -import { AllSeniorInfoResponse } from '../api'; import { allSeniorInfoPath, getAllSeniorInfo, } from '../api/all-senior-info.api'; +import { AllSeniorInfoResponse } from '../types'; import { useQuery } from '@tanstack/react-query'; export const allSeniorInfoQueryKey = [allSeniorInfoPath()]; diff --git a/src/pages/guard/mypage/hooks/useGetGuardInformation.ts b/src/pages/guard/mypage/hooks/useGetGuardInformation.ts index 2fde6a1e..cbd75b05 100644 --- a/src/pages/guard/mypage/hooks/useGetGuardInformation.ts +++ b/src/pages/guard/mypage/hooks/useGetGuardInformation.ts @@ -1,5 +1,6 @@ -import { GuardInformationResponse, getGuardInformation } from '../api'; +import { getGuardInformation } from '../api'; import { guardInformationPath } from '../api/guard-information.api'; +import { GuardInformationResponse } from '../types'; import { useQuery } from '@tanstack/react-query'; export const getGuardInformationQueryKey = [guardInformationPath()]; From 5f02329fdacbd29b89b44bd34c4ae048b8794be6 Mon Sep 17 00:00:00 2001 From: diwoni <70441308+Diwoni@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:26:16 +0900 Subject: [PATCH 7/8] =?UTF-8?q?Fix:=20lint=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/guard/guide-line/hooks/useGetSeniorAllGuideines.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/guard/guide-line/hooks/useGetSeniorAllGuideines.ts b/src/pages/guard/guide-line/hooks/useGetSeniorAllGuideines.ts index bab6c096..929dc138 100644 --- a/src/pages/guard/guide-line/hooks/useGetSeniorAllGuideines.ts +++ b/src/pages/guard/guide-line/hooks/useGetSeniorAllGuideines.ts @@ -1,8 +1,8 @@ import { getSeniorAllGuidelines, getSeniorAllGuidelinesQueryKey, - SeniorAllGuideLineResponse, } from '../api/view-senior-all-guideline.api'; +import { SeniorAllGuideLineResponse } from '../types'; import { useQuery } from '@tanstack/react-query'; export const useGetSeniorAllGuidelines = ( From 4188dd160ed3617acda3a3d3b89a2706843a5d47 Mon Sep 17 00:00:00 2001 From: diwoni <70441308+Diwoni@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:28:14 +0900 Subject: [PATCH 8/8] =?UTF-8?q?Fix:=20build=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/guard/guide-line/hooks/useAddGuideline.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/guard/guide-line/hooks/useAddGuideline.ts b/src/pages/guard/guide-line/hooks/useAddGuideline.ts index d2960836..20b6fb74 100644 --- a/src/pages/guard/guide-line/hooks/useAddGuideline.ts +++ b/src/pages/guard/guide-line/hooks/useAddGuideline.ts @@ -1,4 +1,5 @@ -import { addGuideline, AddGuidelineRequest } from '../api/add-guideline.api'; +import { addGuideline } from '../api/add-guideline.api'; +import { AddGuidelineRequest } from '../types'; import { useMutation, UseMutationResult } from '@tanstack/react-query'; export const useAddGuideline = (