Skip to content

Commit f13a92e

Browse files
committed
fix: 프로젝트 생성 후 편집기로 이동하지않음.
1 parent 37f59f1 commit f13a92e

File tree

2 files changed

+3
-28
lines changed

2 files changed

+3
-28
lines changed

src/components/ui/ProjectCreateModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const CreateProjectModal: React.FC<Props> = ({
8080
const isCurrentlyLoading = isSubmitting || loading;
8181

8282
return (
83-
<div className="fixed inset-0 flex items-center justify-center bg-black/50">
83+
<div className="fixed inset-0 flex items-center justify-center bg-black/50 z-[60]">
8484
<div className="bg-white rounded-lg p-6 w-96">
8585
<h2 className="text-xl font-bold mb-4 text-gray-800">새 프로젝트 만들기</h2>
8686
<label className="block text-sm font-medium text-gray-700 mb-1">프로젝트 이름</label>

src/pages/DashboardPage.tsx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ const DashboardPage: React.FC = () => {
2020
const [searchTerm, setSearchTerm] = useState("");
2121
const [sortOrder, setSortOrder] = useState<"newest" | "oldest">("newest");
2222
const [isModalOpen, setIsModalOpen] = useState(false);
23-
const [isCreating, setIsCreating] = useState(false);
24-
const [deletingIds, setDeletingIds] = useState<Set<string>>(new Set()); // 👈 추가
23+
const [deletingIds, setDeletingIds] = useState<Set<string>>(new Set());
2524

2625
useEffect(() => {
2726
loadProjects();
@@ -60,29 +59,6 @@ const DashboardPage: React.FC = () => {
6059
setIsModalOpen(true);
6160
};
6261

63-
const handleCreateProject = async (name: string, description: string) => {
64-
setIsCreating(true);
65-
try {
66-
// apiFetch는 항상 unwrapped data를 반환
67-
const project = await apiFetch("/api/projects", {
68-
method: "POST",
69-
body: JSON.stringify({ name, description }),
70-
});
71-
72-
if (project?.id) {
73-
await loadProjects();
74-
setIsModalOpen(false);
75-
} else {
76-
throw new Error("프로젝트 생성 응답이 올바르지 않습니다.");
77-
}
78-
} catch (err: any) {
79-
alert("프로젝트 생성 실패: " + (err?.message ?? "unknown error"));
80-
} finally {
81-
setIsCreating(false);
82-
}
83-
};
84-
85-
// 👇 삭제 함수 추가
8662
const handleDeleteProject = async (projectId: string) => {
8763
const ok = window.confirm(
8864
"정말 이 프로젝트를 삭제하시겠어요? 이 작업은 되돌릴 수 없습니다."
@@ -227,8 +203,7 @@ const DashboardPage: React.FC = () => {
227203
<CreateProjectModal
228204
isOpen={isModalOpen}
229205
onClose={() => setIsModalOpen(false)}
230-
onSubmit={handleCreateProject}
231-
isSubmitting={isCreating}
206+
// onSubmit 제거 - ProjectCreateModal의 기본 동작 사용 (편집기로 이동)
232207
/>
233208
)}
234209
</div>

0 commit comments

Comments
 (0)