From f639a827d4a2ccc71c6aab96cdfb8b74337eb09f Mon Sep 17 00:00:00 2001 From: hanif salafi Date: Sun, 20 Jul 2025 16:10:19 +0700 Subject: [PATCH] fixing spit convert --- components/form/content/spit-convert-form.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/form/content/spit-convert-form.tsx b/components/form/content/spit-convert-form.tsx index e8b45723..2790ca38 100644 --- a/components/form/content/spit-convert-form.tsx +++ b/components/form/content/spit-convert-form.tsx @@ -282,7 +282,7 @@ export default function FormConvertSPIT() { const response = await getTagsBySubCategoryId(categoryId); if (response?.data?.data?.length > 0) { // Extract tag names from the response objects - const apiTags = response?.data?.data?.map((tag: any) => tag.tagName || tag.name || tag); + const apiTags = response?.data?.data?.map((tag: any) => tag.tagName); // Merge with existing tags, ensuring uniqueness const tagsMerge = Array.from(new Set([...tags, ...apiTags])); setTags(tagsMerge); @@ -328,7 +328,7 @@ export default function FormConvertSPIT() { // Set content tags and merge with category tags if (details.contentTag) { const contentTags = details.contentTag.split(",").map((tag: string) => tag.trim()); - setTags(prev => [...new Set([...prev, ...contentTags])]); + setTags(prev => Array.from(new Set([...prev, ...contentTags]))); } } catch (error) { console.error("Failed to load detail:", error);