2
0

🐛 (typebotLink) Fix typebotIds infinite query param

This commit is contained in:
Baptiste Arnaud
2023-02-15 16:10:32 +01:00
parent 44d7740952
commit 2f7e71f66e
3 changed files with 25 additions and 61 deletions

View File

@@ -11,7 +11,7 @@ export const useLinkedTypebots = ({
}: {
workspaceId?: string
typebotId?: string
typebotIds?: string[]
typebotIds: string[]
onError: (error: Error) => void
}) => {
const params = stringify({ typebotIds, workspaceId }, { indices: false })
@@ -21,8 +21,8 @@ export const useLinkedTypebots = ({
},
Error
>(
workspaceId
? typebotIds?.every((id) => typebotId === id)
workspaceId && typebotIds.length > 0
? typebotIds.every((id) => typebotId === id)
? undefined
: `/api/typebots?${params}`
: null,