checkpoint
This commit is contained in:
@@ -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" }])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user