Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' of github.com:bcgov/platform-services-registry-api
Browse files Browse the repository at this point in the history
  • Loading branch information
okanji committed Sep 1, 2023
2 parents 468b1fd + 3192bec commit d8ef2e3
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/resolvers/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,22 @@ const User = {
})
.privateCloudProjectSecondaryTechnicalLead(),
isNew: async (user, _, { prisma }) => {
await prisma.user.findUnique({
const result = await prisma.user.findUnique({
where: {
email: user.email,
},
include: {
privateCloudProjectOwner: true,
privateCloudProjectPrimaryTechnicalLead: true,
privateCloudProjectSecondaryTechnicalLead: true,
},
});

return !!user;
return (
result.privateCloudProjectOwner.length > 0 ||
result.privateCloudProjectPrimaryTechnicalLead.length > 0 ||
result.privateCloudProjectSecondaryTechnicalLead.length > 0
);
},
};

Expand Down

0 comments on commit d8ef2e3

Please sign in to comment.