added working pages animal and thing
This commit is contained in:
@@ -26,7 +26,7 @@ export default function CreateUpdatePost({ onClose, onSuccess, initialData }) {
|
||||
const [form, setForm] = useState(
|
||||
isEdit
|
||||
? {
|
||||
type: initialData.type || "loss",
|
||||
type: (initialData.type || "loss").toLowerCase(),
|
||||
title: initialData.title || "",
|
||||
description: initialData.description || "",
|
||||
category: initialData.category || "",
|
||||
@@ -100,7 +100,7 @@ export default function CreateUpdatePost({ onClose, onSuccess, initialData }) {
|
||||
}
|
||||
|
||||
const data = new FormData();
|
||||
data.append("type", form.type);
|
||||
data.append("type", form.type.toUpperCase()); // "loss" → "LOSS", "found" → "FOUND" для enum на бэкенде
|
||||
data.append("title", form.title.trim());
|
||||
data.append("description", form.description.trim());
|
||||
data.append("category", form.category);
|
||||
|
||||
Reference in New Issue
Block a user