Skip to content

Commit

Permalink
#81 Handle some edge cases in user persistence where if undefined was…
Browse files Browse the repository at this point in the history
… passed an arbitrary user was resolved
  • Loading branch information
danielemery committed Jan 7, 2024
1 parent e8fe300 commit 5baafe8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/user/user.persistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class UserPersistence {
}

async getUserByEmail(email: string) {
if (!email) return null;
return this.#prisma.client().user.findFirst({
include: {
roles: {},
Expand All @@ -31,6 +32,7 @@ export class UserPersistence {
}

async getUserById(id: string) {
if (!id) return null;
return this.#prisma.client().user.findFirst({
where: {
id,
Expand Down

0 comments on commit 5baafe8

Please sign in to comment.