260819_01_ENH: 자체보고서 업로드 막혀있던 버그 수정

This commit is contained in:
2026-08-19 11:09:09 +09:00
parent 5f7bf5ce1b
commit d84c8b2c34

View File

@@ -51,6 +51,7 @@ import {
openWrittenReviewWindow,
} from "@/lib/gwcf/file";
import {PERFORMANCE_FIELD_LABELS, USER_FIELD_LABELS} from "@/lib/gwcf/field-labels";
import {useAuth} from "@/hooks/useAuth";
type CodeMap = Partial<Record<CodeGroup, Code[]>>;
type PerformanceDetail = PerformanceCompact["performanceDetail"];
@@ -232,9 +233,11 @@ function EvidenceZipButton({performanceId, userId}: {performanceId: number; user
function LocalGovernmentReviewRow({
performance,
codes,
loginUserId,
}: {
performance: PerformanceFull | PerformanceCompact;
codes: CodeMap;
loginUserId: string | undefined;
}) {
const reviewType = LOCAL_GOVERNMENT_REVIEW_TYPE;
const fallbackReviewRow = getReviewByType(performance as PerformanceFull, reviewType);
@@ -257,7 +260,7 @@ function LocalGovernmentReviewRow({
<ReviewFileActions
performanceId={performance.id}
reviewType={reviewType}
userId={review?.regUser || userId}
userId={review?.regUser || userId || loginUserId}
uploadFileName={review?.uploadFileName}
pdfFileName={review?.pdfFileName}
pdfConvert={review?.pdfConvert}
@@ -439,6 +442,7 @@ export function PerformanceDetailDialog({
onSave?: (performance: PerformanceCompact) => void;
onDelete?: (performanceId: number) => void;
}>) {
const {auth} = useAuth();
const [draft, setDraft] = useState<PerformanceCompact | null>(null);
const [isEditing, setIsEditing] = useState(false);
const {data: monitoringUsers = []} = useUsersQuery(ROLE.MONITORING, open);
@@ -452,6 +456,8 @@ export function PerformanceDetailDialog({
[writtenUsers]
);
const userId = auth.user?.userId;
useEffect(() => {
if (!performance) {
setDraft(null);
@@ -635,7 +641,7 @@ export function PerformanceDetailDialog({
</Button>
</div>
</div>
<LocalGovernmentReviewRow performance={performance ?? draft} codes={codes} />
<LocalGovernmentReviewRow performance={performance ?? draft} codes={codes} loginUserId={userId} />
<MonitoringStatusRow performance={performance ?? draft} index={0} codes={codes} userMap={monitoringUserMap} canEdit={canEdit} />
<MonitoringStatusRow performance={performance ?? draft} index={1} codes={codes} userMap={monitoringUserMap} canEdit={canEdit} />
<WrittenReviewRows performance={performance ?? draft} codes={codes} userMap={writtenUserMap} canEdit={canEdit} />