feat: update fixing create category

This commit is contained in:
hanif salafi 2025-06-10 08:41:24 +07:00
parent a0ee6421d1
commit b6d4b2a59a
1 changed files with 8 additions and 3 deletions

View File

@ -133,9 +133,14 @@ export default function MasterCategoryTable() {
}; };
const response = await createCategory(formData); const response = await createCategory(formData);
console.log(response);
if (response?.error) { if (response?.error) {
error(response.message); console.log()
if (response.message?.messages[0]?.includes("article_categories_title_unique")) {
error("Judul sudah tersedia, silahkan buat dengan judul berbeda");
} else {
error(response.message?.messages);
}
return false; return false;
} }
const categoryId = response?.data?.data?.id; const categoryId = response?.data?.data?.id;
@ -257,7 +262,7 @@ export default function MasterCategoryTable() {
)} )}
</div> </div>
<div className="flex flex-col gap-1"> <div className="flex flex-col gap-1">
<p className="text-sm mt-3">Parent</p> <p className="text-sm mt-3">Parent Kategori <span>(Optional)</span></p>
<ReactSelect <ReactSelect
className="basic-single text-black z-50" className="basic-single text-black z-50"