continued
implemented HTMX implemented ORM (sequelize)
This commit is contained in:
parent
2a9bd4e81b
commit
d756a192e4
71 changed files with 3822 additions and 694 deletions
18
routes/htmx/admin/groups/table.mjs
Normal file
18
routes/htmx/admin/groups/table.mjs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
import {
|
||||
Group
|
||||
} from "../../../../lib/database/connect.mjs";
|
||||
|
||||
|
||||
export const get = async function (request, response) {
|
||||
if (request.getAuthState() != 'authenticated') {
|
||||
response.set('HX-Redirect', '/login').status(401).end();
|
||||
return;
|
||||
}
|
||||
|
||||
let groupList = await Group.findAll();
|
||||
|
||||
response.render(`views/htmx/admin/groupTable.njk`, {
|
||||
groupList: groupList
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue