feat(backend): Added flows endpoint for translator invites
This commit is contained in:
parent
064b058fd6
commit
1bc256fb05
12 changed files with 249 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue