260728_01_ENH: 연구원 계정에 사업 삭제 기능 부여

This commit is contained in:
2026-07-28 14:57:57 +09:00
parent cb4054e9e7
commit cc905433d3
3 changed files with 34 additions and 1 deletions

View File

@@ -426,14 +426,18 @@ export function PerformanceDetailDialog({
performance,
codes,
canEdit,
canDelete,
onSave,
onDelete,
}: Readonly<{
open: boolean;
onOpenChange: (open: boolean) => void;
performance: PerformanceFull | PerformanceCompact | null;
codes: CodeMap;
canEdit: boolean;
canDelete: boolean;
onSave?: (performance: PerformanceCompact) => void;
onDelete?: (performanceId: number) => void;
}>) {
const [draft, setDraft] = useState<PerformanceCompact | null>(null);
const [isEditing, setIsEditing] = useState(false);
@@ -535,6 +539,14 @@ export function PerformanceDetailDialog({
setIsEditing(false);
};
const deletePerformance = () => {
if(!draft) return;
if(confirm("삭제 되면 복구할 수 없습니다. 삭제를 진행 하시겠습니까?")){
onDelete?.(draft.id);
}
}
const downloadTemplate = (reviewType: number, classification: number) => {
downloadFromUrl(`/api/review/template/download/${reviewType}/${classification}`);
};
@@ -633,6 +645,7 @@ export function PerformanceDetailDialog({
</div>
<DialogFooter className="shrink-0 border-t pt-4">
{canDelete && draft && <Button type="button" variant="destructive" onClick={deletePerformance}>삭제</Button>}
{canEdit && draft && !isEditing && <Button type="button" onClick={() => setIsEditing(true)}>수정</Button>}
{canEdit && draft && isEditing && (
<>