1
0
Fork 0

feat(backend): Added flows endpoint for translator invites

This commit is contained in:
joostdecock 2023-07-09 16:26:19 +02:00
parent 064b058fd6
commit 1bc256fb05
12 changed files with 249 additions and 0 deletions

View file

@ -125,6 +125,23 @@ UserModel.prototype.loadAuthenticatedUser = async function (user) {
return this
}
/*
* Loads & reveals the user that is making the API request
e
* Stores result in this.record
*/
UserModel.prototype.revealAuthenticatedUser = async function (user) {
if (!user) return this
this.record = await this.prisma.user.findUnique({
where: { id: user.uid },
include: {
apikeys: true,
},
})
return this.reveal()
}
/*
* Checks this.record and sets a boolean to indicate whether
* the user exists or not