@@ -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