From 6a1a1ba263b93ddb4e52cfe2d61f3480137250f4 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Mon, 13 Jul 2026 11:35:47 +0900 Subject: [PATCH] =?UTF-8?q?260713=5F01=5FENH:=20=EB=AF=B8=EC=A7=84?= =?UTF-8?q?=ED=96=89=EC=9D=B8=20=EB=AA=A8=EB=8B=88=ED=84=B0=EB=A7=81=20?= =?UTF-8?q?=ED=8F=89=EA=B0=80=EC=97=90=20=EB=8C=80=ED=95=B4=EC=84=9C?= =?UTF-8?q?=EB=8F=84=20upload=EA=B0=80=20=EA=B0=80=EB=8A=A5=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EC=9E=AC?= =?UTF-8?q?=EB=8B=A8=20=EA=B3=84=EC=A0=95=EC=97=90=EC=84=9C=EB=8F=84=20?= =?UTF-8?q?=EC=97=85=EB=A1=9C=EB=93=9C=20=EA=B0=80=EB=8A=A5=ED=95=98?= =?UTF-8?q?=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/api/review/[[...slug]]/route.ts | 4 +++- .../dialog/PerformanceDetailDialog.tsx | 12 ++++++++---- src/query/review.ts | 18 ++++++++++++++++-- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/src/app/api/review/[[...slug]]/route.ts b/src/app/api/review/[[...slug]]/route.ts index 1b4eecb..1fe43c7 100644 --- a/src/app/api/review/[[...slug]]/route.ts +++ b/src/app/api/review/[[...slug]]/route.ts @@ -168,10 +168,12 @@ export const POST = async ( const backendForm = new FormData(); backendForm.append("file", file, file.name); + const paramUserId = req.nextUrl.searchParams.get("paramUserId") ?? undefined; const result = await backApi.postForm( `/review/${encodeURIComponent(action)}/${encodeURIComponent(second)}`, - backendForm + backendForm, + { query: paramUserId ? { paramUserId } : undefined } ); return NextResponse.json(result, { status: 200 }); } diff --git a/src/components/dialog/PerformanceDetailDialog.tsx b/src/components/dialog/PerformanceDetailDialog.tsx index b5b6d73..e66d989 100644 --- a/src/components/dialog/PerformanceDetailDialog.tsx +++ b/src/components/dialog/PerformanceDetailDialog.tsx @@ -146,7 +146,9 @@ function ReviewFileActions({ const upload = async (file?: File) => { try { if (!file) return; - await withLoadingAsync(() => uploadMutation.mutateAsync({performanceId, reviewType, file})); + await withLoadingAsync(() => + uploadMutation.mutateAsync({performanceId, reviewType, file, paramUserId: userId}) + ); alert("파일 업로드가 완료되었습니다."); } finally { if (fileInputRef.current) fileInputRef.current.value = ""; @@ -179,7 +181,7 @@ function ReviewFileActions({ return (
- {canEdit && ( + {canEdit && userId && ( <> void upload(event.target.files?.[0])} /> fileInputRef.current?.click()}>파일 업로드 @@ -335,8 +337,10 @@ function MonitoringStatusRow({ uploadFileName={row.review?.uploadFileName} pdfFileName={row.review?.pdfFileName} pdfConvert={row.review?.pdfConvert} - canUpload={canEdit && isReviewComplete(row.review)} - canEdit={canEdit} + //canUpload={canEdit && isReviewComplete(row.review)} + //canEdit={canEdit} + canUpload={true} + canEdit={true} />
{row.slot.visit?.length ? ( diff --git a/src/query/review.ts b/src/query/review.ts index a979b55..a5973f5 100644 --- a/src/query/review.ts +++ b/src/query/review.ts @@ -19,10 +19,24 @@ export function useUploadReviewFileMutation() { const qc = useQueryClient(); return useMutation({ - mutationFn: ({performanceId, reviewType, file}: {performanceId: number; reviewType: number; file: File}) => { + mutationFn: ({ + performanceId, + reviewType, + file, + paramUserId, + }: { + performanceId: number; + reviewType: number; + file: File; + paramUserId?: string; + }) => { const formData = new FormData(); formData.append("file", file, file.name); - return nextApi.postForm(`/review/${performanceId}/${reviewType}`, formData); + return nextApi.postForm( + `/review/${performanceId}/${reviewType}`, + formData, + {query: paramUserId ? {paramUserId} : undefined} + ); }, onSuccess: (_res, {performanceId, reviewType}) => { qc.invalidateQueries({ queryKey: ["review", performanceId, reviewType] }); -- 2.49.0.windows.1