diff --git a/src/index.ts b/src/index.ts index 3e9431f..f01311f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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); } diff --git a/src/templates/gamble.ejs b/src/templates/gamble.ejs index a74bab8..c6fc42e 100644 --- a/src/templates/gamble.ejs +++ b/src/templates/gamble.ejs @@ -5,7 +5,7 @@ - +
- Name: <%= person.name %> -
-- Points: <%= person.pointsTotal %> -
+ +