@@ -4,7 +4,7 @@ import { useUIStore } from '@/lib/store/uiStore';
44import { Dialog , DialogContent , DialogTitle } from '@/components/ui/dialog' ;
55import { useState } from 'react' ;
66import { useCreateFolder } from '@/lib/api/folderApi' ;
7- import { TEMP_MEMBER_ID } from '@/lib/auth/currentUser ' ;
7+ import { useAuthStore } from '@/lib/store/authStore ' ;
88
99const COLORS = [
1010 { id : 'purple' , base : 'bg-purple-500 hover:ring-purple-500' , active : 'ring-purple-500 shadow-[0_0_8px_rgba(168,85,247,0.5)]' } ,
@@ -28,6 +28,7 @@ export function CreateFolderDialog() {
2828 const [ selectedIcon , setSelectedIcon ] = useState ( 'work' ) ; // 선택된 아이콘 이름
2929 const [ selectedColor , setSelectedColor ] = useState ( 'purple' ) ; // 선택된 색상 ID
3030 const [ isPinned , setIsPinned ] = useState ( true ) ; // 상단 고정 여부
31+ const memberId = useAuthStore ( ( s ) => s . member ?. memberId ) ;
3132
3233 // 폴더 생성 API 연동 (React Query Mutation)
3334 const createFolderMutation = useCreateFolder ( ) ;
@@ -38,12 +39,12 @@ export function CreateFolderDialog() {
3839 */
3940 const handleCreateFolder = ( ) => {
4041 // 유효성 검사: 이름이 비어있으면 중단
41- if ( ! folderName . trim ( ) ) return ;
42+ if ( ! folderName . trim ( ) || ! memberId ) return ;
4243
4344 // API 호출
4445 createFolderMutation . mutate (
4546 {
46- ownerMemberId : TEMP_MEMBER_ID , // 현재는 테스트용 ID 사용
47+ ownerMemberId : memberId ,
4748 folderName : folderName . trim ( ) ,
4849 } ,
4950 {
0 commit comments