fixing spit convert
This commit is contained in:
parent
007a6d9eec
commit
f639a827d4
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue