checkpoint

This commit is contained in:
2025-08-19 22:19:24 -04:00
parent 287c19fc0d
commit 265aad4522
4 changed files with 54 additions and 4 deletions

View File

@@ -36,8 +36,16 @@ const api = new Elysia({ prefix: "/api" })
}),
}
)
.get("/profile", ({ humanKey }) =>
db.human.findFirst({ where: { key: humanKey } })
.get("/profile", ({ humanKey, query: { otherHumanKey } }) =>
db.human
.findFirst({ where: { key: otherHumanKey ?? humanKey } })
.then((human) => {
if (human == null) {
return null;
}
const { token, ...safeProfile } = human;
return safeProfile;
})
)
.get("/games", () => [{ key: "simple", name: "simple" }])