fix menu with parent data and remove action google sheet not available feature

This commit is contained in:
arifal
2025-03-21 14:54:18 +07:00
parent f36f250700
commit d7bff86741
6 changed files with 54 additions and 34 deletions

View File

@@ -39,7 +39,7 @@ class Menus {
"Name",
"Url",
"Icon",
"ParentID",
"Parent Name",
"Sort Order",
{
name: "Action",
@@ -97,16 +97,22 @@ class Menus {
.getAttribute("content")}`,
"Content-Type": "application/json",
},
then: (data) =>
data.data.map((item) => [
item.id,
item.name,
item.url,
item.icon,
item.parent_id,
item.sort_order,
item.id,
]),
then: (data) => {
console.log("Full API Response:", data); // Log the full response
return data.data.map((item, index) => {
console.log(`Item ${index + 1}:`, item); // Log each item
return [
item.id,
item.name,
item.url,
item.icon,
item.parent?.name,
item.sort_order,
item.id,
];
});
},
total: (data) => data.total,
},
}).render(tableContainer);