🐛 Remove publicId and customDomain duplication on imported bots

This commit is contained in:
Baptiste Arnaud
2023-08-17 16:32:37 +02:00
parent 906845bd76
commit 304dfe2dab
17 changed files with 61 additions and 70 deletions

View File

@@ -48,7 +48,7 @@ export const createCredentials = authenticatedProcedure
},
select: { id: true, members: true },
})
if (!workspace || (await isWriteWorkspaceForbidden(workspace, user)))
if (!workspace || isWriteWorkspaceForbidden(workspace, user))
throw new TRPCError({ code: 'NOT_FOUND', message: 'Workspace not found' })
const { encryptedData, iv } = await encrypt(credentials.data)

View File

@@ -33,7 +33,7 @@ export const deleteCredentials = authenticatedProcedure
},
select: { id: true, members: true },
})
if (!workspace || (await isWriteWorkspaceForbidden(workspace, user)))
if (!workspace || isWriteWorkspaceForbidden(workspace, user))
throw new TRPCError({
code: 'NOT_FOUND',
message: 'Workspace not found',

View File

@@ -51,7 +51,7 @@ export const listCredentials = authenticatedProcedure
},
},
})
if (!workspace || (await isReadWorkspaceFobidden(workspace, user)))
if (!workspace || isReadWorkspaceFobidden(workspace, user))
throw new TRPCError({ code: 'NOT_FOUND', message: 'Workspace not found' })
return { credentials: workspace.credentials }