(null);
+ const [category, setCategory] = useState("");
useEffect(() => {
if (!files || files.length === 0) {
@@ -47,10 +57,11 @@ export function GaleriDialog({ open, onClose, onSubmit }: any) {
const handleSubmit = async () => {
try {
if (!title) return alert("Judul wajib diisi!");
-
+ if (!category) return alert("Category wajib diisi!");
const formData = new FormData();
formData.append("title", title);
formData.append("description", description);
+ formData.append("category", category);
const res = await createGalery(formData);
@@ -73,7 +84,7 @@ export function GaleriDialog({ open, onClose, onSubmit }: any) {
}
onSubmit();
-
+ setCategory("");
setTitle("");
setDescription("");
setFiles([]);
@@ -106,6 +117,26 @@ export function GaleriDialog({ open, onClose, onSubmit }: any) {
/>
+ {/* Category */}
+
+
+
+
+
+
{/* Deskripsi */}