diff --git a/frontend/src/api/reviewApi.ts b/frontend/src/api/reviewApi.ts index d42974b..964f8c8 100644 --- a/frontend/src/api/reviewApi.ts +++ b/frontend/src/api/reviewApi.ts @@ -1,5 +1,5 @@ import api from '@/api/axiosConfig'; -import { ReviewDetailResponse, ReviewRequest, ReviewResponse } from '@/types'; +import { ReviewDetailResponse, ReviewRequest, ReviewResponse, ReviewStatus } from '@/types'; // 리뷰 단건 조회 export async function getReviewDetail(projectId: number, reviewId: number, memberId: number) { @@ -49,7 +49,7 @@ export async function getReviewByStatus( projectId: number, memberId: number, sortDirection: number, - reviewStatus?: 'REQUESTED' | 'APPROVED' | 'REJECTED', + reviewStatus?: ReviewStatus, lastReviewId?: number, limitPage: number = 10 ) { diff --git a/frontend/src/api/workspaceApi.ts b/frontend/src/api/workspaceApi.ts index 9ff1bed..08480a1 100644 --- a/frontend/src/api/workspaceApi.ts +++ b/frontend/src/api/workspaceApi.ts @@ -5,6 +5,7 @@ import { WorkspaceResponse, ReviewResponse, WorkspaceMemberResponse, + ReviewStatus, } from '@/types'; export async function getWorkspaceList(memberId: number, lastWorkspaceId?: number, limit?: number) { @@ -59,7 +60,7 @@ export async function getWorkspaceReviews( workspaceId: number, memberId: number, sortDirection: number, - reviewStatus?: 'REQUESTED' | 'APPROVED' | 'REJECTED', + reviewStatus?: ReviewStatus, lastReviewId?: number, limitPage: number = 10 ) { diff --git a/frontend/src/components/ReviewList/ReviewItem.tsx b/frontend/src/components/ReviewList/ReviewItem.tsx index 3e599e1..a840d02 100644 --- a/frontend/src/components/ReviewList/ReviewItem.tsx +++ b/frontend/src/components/ReviewList/ReviewItem.tsx @@ -2,13 +2,14 @@ import { Briefcase, Tag, Box, Layers } from 'lucide-react'; import { Link } from 'react-router-dom'; import useProjectQuery from '@/queries/projects/useProjectQuery'; import useAuthStore from '@/stores/useAuthStore'; +import { ReviewStatus } from '@/types'; interface ReviewItemProps { title: string; createdTime: string; creatorName: string; projectId: number; - status: 'REQUESTED' | 'APPROVED' | 'REJECTED'; + status: ReviewStatus; type?: { text: 'classification' | 'detection' | 'segmentation'; color: string }; workspaceId: number; reviewId: number; diff --git a/frontend/src/components/ReviewList/index.tsx b/frontend/src/components/ReviewList/index.tsx index dc6e7f7..fa4ed49 100644 --- a/frontend/src/components/ReviewList/index.tsx +++ b/frontend/src/components/ReviewList/index.tsx @@ -1,11 +1,11 @@ import ReviewItem from './ReviewItem'; import ReviewSearchInput from './ReviewSearchInput'; -import { ReviewResponse } from '@/types'; +import { ReviewResponse, ReviewStatus } from '@/types'; interface ReviewListProps { reviews: ReviewResponse[]; - activeTab: 'REQUESTED' | 'APPROVED' | 'REJECTED' | 'all'; - setActiveTab: React.Dispatch>; + activeTab: ReviewStatus | 'all'; + setActiveTab: React.Dispatch>; setSearchQuery: React.Dispatch>; sortValue: string; setSortValue: React.Dispatch>; diff --git a/frontend/src/mocks/reviewHandlers.ts b/frontend/src/mocks/reviewHandlers.ts index 72372e4..d5b54f1 100644 --- a/frontend/src/mocks/reviewHandlers.ts +++ b/frontend/src/mocks/reviewHandlers.ts @@ -1,5 +1,5 @@ import { http, HttpResponse } from 'msw'; -import { ReviewDetailResponse, ReviewRequest, ReviewResponse, ReviewStatusRequest } from '@/types'; +import { ReviewDetailResponse, ReviewRequest, ReviewResponse, ReviewStatus, ReviewStatusRequest } from '@/types'; export const reviewHandlers = [ // 리뷰 단건 조회 핸들러 @@ -145,7 +145,7 @@ export const reviewHandlers = [ reviewId: index + 1, title: `Review ${index + 1}`, content: `Review content ${index + 1}`, - status: (reviewStatus || 'REQUESTED') as 'REQUESTED' | 'APPROVED' | 'REJECTED', + status: (reviewStatus || 'REQUESTED') as ReviewStatus, createAt: new Date().toISOString(), updateAt: new Date().toISOString(), author: { id: 1, nickname: 'Author', profileImage: '', email: 'author@example.com' }, diff --git a/frontend/src/pages/ProjectReviewList.tsx b/frontend/src/pages/ProjectReviewList.tsx index b213701..f0b18bf 100644 --- a/frontend/src/pages/ProjectReviewList.tsx +++ b/frontend/src/pages/ProjectReviewList.tsx @@ -4,13 +4,14 @@ import useReviewByStatusQuery from '@/queries/reviews/useReviewByStatusQuery'; import useAuthStore from '@/stores/useAuthStore'; import ReviewList from '@/components/ReviewList'; import { Button } from '@/components/ui/button'; +import { ReviewStatus } from '@/types'; export default function ProjectReviewList() { const { workspaceId, projectId } = useParams<{ workspaceId: string; projectId: string }>(); const profile = useAuthStore((state) => state.profile); const memberId = profile?.id || 0; - const [activeTab, setActiveTab] = useState<'REQUESTED' | 'APPROVED' | 'REJECTED' | 'all'>('REQUESTED'); + const [activeTab, setActiveTab] = useState('REQUESTED'); const [, setSearchQuery] = useState(''); const [sortValue, setSortValue] = useState('latest'); diff --git a/frontend/src/pages/ReviewDetail.tsx b/frontend/src/pages/ReviewDetail.tsx index 210a275..c909f1e 100644 --- a/frontend/src/pages/ReviewDetail.tsx +++ b/frontend/src/pages/ReviewDetail.tsx @@ -111,7 +111,7 @@ export default function ReviewDetail(): JSX.Element { )} - {(reviewDetail.reviewStatus === 'APPROVED' || reviewDetail.reviewStatus === 'REJECTED') && ( + {(reviewDetail.reviewStatus === 'APPROVED' || reviewDetail.reviewStatus === 'REJECT') && (

리뷰 상태: {reviewDetail.reviewStatus === 'APPROVED' ? '승인됨' : '거부됨'} @@ -137,7 +137,7 @@ export default function ReviewDetail(): JSX.Element { - {isAdminOrManager && reviewDetail.reviewStatus !== 'APPROVED' && reviewDetail.reviewStatus !== 'REJECTED' && ( + {isAdminOrManager && reviewDetail.reviewStatus !== 'APPROVED' && reviewDetail.reviewStatus !== 'REJECT' && ( <>