This commit is contained in:
2024-09-03 17:09:28 +02:00
parent 4e5c27d920
commit 91d32f2f71
5 changed files with 83 additions and 10 deletions

View File

@ -120,7 +120,11 @@ app.get("/person/:id", async (req, res) => {
return;
}
ejs.renderFile('src/templates/person.ejs', { person: person }, function (err, str) {
let points = await db.query.pointsTable.findMany({
where: eq(pointsTable.personId, id)
});
ejs.renderFile('src/templates/person.ejs', { person: person, points: JSON.stringify(points) }, function (err, str) {
if (err) {
res.status(500).send(err);
}