Skip to content

Commit

Permalink
🐛 (fileUpload) Fix private file upload URLs
Browse files Browse the repository at this point in the history
Closes #1761
  • Loading branch information
baptisteArno committed Sep 4, 2024
1 parent 653ef4e commit 2a767e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/viewer/src/features/fileUpload/api/generateUploadUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const generateUploadUrl = publicProcedure

const typebotId = session.state.typebotsQueue[0].typebot.id

const isPreview = session.state.typebotsQueue[0].resultId
const isPreview = !session.state.typebotsQueue[0].resultId

const typebot = session.state.typebotsQueue[0].resultId
? await getAndParsePublicTypebot(
Expand Down Expand Up @@ -99,7 +99,7 @@ export const generateUploadUrl = publicProcedure
const resultId = session.state.typebotsQueue[0].resultId

const filePath =
'workspaceId' in typebot && typebot.workspaceId
'workspaceId' in typebot && typebot.workspaceId && resultId
? `${visibility === 'Private' ? 'private' : 'public'}/workspaces/${
typebot.workspaceId
}/typebots/${typebotId}/results/${resultId}/${fileName}`
Expand Down

0 comments on commit 2a767e0

Please sign in to comment.