fix: If user not found
This commit is contained in:
parent
c55505af6c
commit
a82805846f
1 changed files with 1 additions and 1 deletions
|
|
@ -80,7 +80,7 @@ export const getTeam = (event) => {
|
||||||
|
|
||||||
export const getUserDetails = async (event, isAdminRequired = true) => {
|
export const getUserDetails = async (event, isAdminRequired = true) => {
|
||||||
const teamId = getTeam(event);
|
const teamId = getTeam(event);
|
||||||
const userId = event.locals.session.data.userId || null;
|
const userId = event?.locals?.session?.data?.userId || null;
|
||||||
const { permission = 'read' } = await db.prisma.permission.findFirst({
|
const { permission = 'read' } = await db.prisma.permission.findFirst({
|
||||||
where: { teamId, userId },
|
where: { teamId, userId },
|
||||||
select: { permission: true },
|
select: { permission: true },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue