🐛 Remove publicId and customDomain duplication on imported bots
This commit is contained in:
@@ -30,7 +30,7 @@ export const deleteWorkspace = authenticatedProcedure
|
||||
include: { members: true },
|
||||
})
|
||||
|
||||
if (!workspace || (await isAdminWriteWorkspaceForbidden(workspace, user)))
|
||||
if (!workspace || isAdminWriteWorkspaceForbidden(workspace, user))
|
||||
throw new TRPCError({ code: 'NOT_FOUND', message: 'No workspaces found' })
|
||||
|
||||
await prisma.workspace.deleteMany({
|
||||
|
||||
@@ -31,7 +31,7 @@ export const getWorkspace = authenticatedProcedure
|
||||
include: { members: true },
|
||||
})
|
||||
|
||||
if (!workspace || (await isReadWorkspaceFobidden(workspace, user)))
|
||||
if (!workspace || isReadWorkspaceFobidden(workspace, user))
|
||||
throw new TRPCError({ code: 'NOT_FOUND', message: 'No workspaces found' })
|
||||
|
||||
return {
|
||||
|
||||
@@ -31,7 +31,7 @@ export const listInvitationsInWorkspace = authenticatedProcedure
|
||||
include: { members: true, invitations: true },
|
||||
})
|
||||
|
||||
if (!workspace || (await isReadWorkspaceFobidden(workspace, user)))
|
||||
if (!workspace || isReadWorkspaceFobidden(workspace, user))
|
||||
throw new TRPCError({ code: 'NOT_FOUND', message: 'No workspaces found' })
|
||||
|
||||
return { invitations: workspace.invitations }
|
||||
|
||||
@@ -37,7 +37,7 @@ export const listMembersInWorkspace = authenticatedProcedure
|
||||
},
|
||||
})
|
||||
|
||||
if (!workspace || (await isReadWorkspaceFobidden(workspace, user)))
|
||||
if (!workspace || isReadWorkspaceFobidden(workspace, user))
|
||||
throw new TRPCError({ code: 'NOT_FOUND', message: 'No workspaces found' })
|
||||
|
||||
return {
|
||||
|
||||
@@ -41,7 +41,7 @@ export const updateWorkspace = authenticatedProcedure
|
||||
if (!workspace)
|
||||
throw new TRPCError({ code: 'NOT_FOUND', message: 'Workspace not found' })
|
||||
|
||||
if (await isAdminWriteWorkspaceForbidden(workspace, user))
|
||||
if (isAdminWriteWorkspaceForbidden(workspace, user))
|
||||
throw new TRPCError({
|
||||
code: 'FORBIDDEN',
|
||||
message: 'You are not allowed to update this workspace',
|
||||
|
||||
Reference in New Issue
Block a user