create user role and menu, create seeder for first user and create crud role, menu and user

This commit is contained in:
arifal
2025-02-11 02:35:53 +07:00
parent 6307417ae3
commit cb90f69d1e
37 changed files with 1326 additions and 151 deletions

View File

@@ -17,6 +17,15 @@ class UsersTable {
"Firstname",
"Lastname",
"Position",
"Roles",
{
name: "Action",
formatter: (cell) =>
gridjs.html(`
<div class="d-flex justify-content-end gap-x-2">
<a href="/master/users/${cell}/edit" class="btn btn-yellow me-2">Update</a>
`),
},
],
pagination: {
limit: 15,
@@ -42,15 +51,19 @@ class UsersTable {
.getAttribute("content")}`,
"Content-Type": "application/json",
},
then: (data) =>
data.data.map((item) => [
then: (data) => {
console.log(data.data);
return data.data.map((item) => [
item.id,
item.name,
item.email,
item.firstname,
item.lastname,
item.position,
]),
item.roles,
item.id,
]);
},
total: (data) => data.meta.total,
},
}).render(document.getElementById("table-users"));