🛂 Prevent blocking everything once limit is reached
The idea is to make the hard limit less scary. I'd prefer manually reaching out to users when they are over their monthly limit
This commit is contained in:
@@ -284,19 +284,12 @@ const getTypebot = async (
|
||||
message: 'Typebot is closed',
|
||||
})
|
||||
|
||||
const hasReachedLimit =
|
||||
typebotQuery && 'typebot' in typebotQuery
|
||||
? await checkChatsUsage({
|
||||
typebotId: parsedTypebot.id,
|
||||
workspace: typebotQuery.typebot.workspace,
|
||||
})
|
||||
: false
|
||||
|
||||
if (hasReachedLimit)
|
||||
throw new TRPCError({
|
||||
code: 'FORBIDDEN',
|
||||
message: 'You have reached your chats limit',
|
||||
})
|
||||
typebotQuery && 'typebot' in typebotQuery
|
||||
? await checkChatsUsage({
|
||||
typebotId: parsedTypebot.id,
|
||||
workspace: typebotQuery.typebot.workspace,
|
||||
})
|
||||
: false
|
||||
|
||||
return parsedTypebot
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user