
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
    });
}