2
0

🛂 Add isSuspended prop on workspace

This commit is contained in:
Baptiste Arnaud
2023-07-04 14:56:36 +02:00
parent 92740ad2ff
commit 5a05310a9c
9 changed files with 95 additions and 13 deletions

View File

@@ -301,6 +301,7 @@ const getTypebot = async (
additionalChatsIndex: true,
customChatsLimit: true,
isQuarantined: true,
isSuspended: true,
},
},
},
@@ -326,12 +327,16 @@ const getTypebot = async (
message: 'Typebot not found',
})
const isQuarantined =
const isQuarantinedOrSuspended =
typebotQuery &&
'typebot' in typebotQuery &&
typebotQuery.typebot.workspace.isQuarantined
(typebotQuery.typebot.workspace.isQuarantined ||
typebotQuery.typebot.workspace.isSuspended)
if (('isClosed' in parsedTypebot && parsedTypebot.isClosed) || isQuarantined)
if (
('isClosed' in parsedTypebot && parsedTypebot.isClosed) ||
isQuarantinedOrSuspended
)
throw new TRPCError({
code: 'BAD_REQUEST',
message: 'Typebot is closed',