This commit is contained in:
박원엽
2026-05-28 16:52:33 +09:00
parent 116b9a4fd2
commit f4481b88cb
13 changed files with 1853 additions and 454 deletions

View File

@@ -7,6 +7,7 @@ import { createPost, updatePost, getPost } from '@/api/posts';
import { getCategories } from '@/api/category';
import { uploadImage } from '@/api/image';
import { useAuthStore } from '@/store/authStore';
import { PostSaveRequest } from '@/types';
import { Loader2, Save, Image as ImageIcon, ArrowLeft, Folder, UploadCloud, FileText, Trash2, X, Clock } from 'lucide-react';
import toast from 'react-hot-toast';
import dynamic from 'next/dynamic';
@@ -165,7 +166,7 @@ function WritePageContent() {
};
const mutation = useMutation({
mutationFn: (data: any) => isEditMode ? updatePost(existingPost!.id, data) : createPost(data),
mutationFn: (data: PostSaveRequest) => isEditMode ? updatePost(existingPost!.id, data) : createPost(data),
onSuccess: async (response: any) => {
const savedPost = response?.data;
const newSlug = savedPost?.slug || editSlug;
@@ -521,4 +522,4 @@ export default function WritePage() {
<WritePageContent />
</Suspense>
);
}
}