Current (non-working-frontend) state

This commit is contained in:
2023-05-22 18:39:47 +02:00
parent b29550f429
commit cfc28c5959
13 changed files with 354 additions and 89 deletions

View File

@ -25,7 +25,11 @@ async function get(req: Request, res: Response) {
prisma.item
.findMany({ skip: (page - 1) * takeSize, take: takeSize }) // Skip the amount of items per page times the page number minus 1; skip has to be (page-1)*takeSize because skip is 0 indexed
.then((items) => {
res.render(__path + '/src/frontend/items.eta.html', { items: items, currentPage: page, maxPages: pageSize });
prisma.storageLocation.findMany({}).then((locations) => {
prisma.itemCategory.findMany({}).then((categories) => {
res.render(__path + '/src/frontend/items.eta.html', { items: items, currentPage: page, maxPages: pageSize, storeLocs: locations, categories: categories });
});
});
})
.catch((err) => {
console.error(err);