MCPcopy Index your code
hub / github.com/simstudioai/sim / parseUploadResponse

Function parseUploadResponse

apps/sim/hooks/queries/workspace-files.ts:321–334  ·  view source on GitHub ↗
(
  response: Response,
  fallbackMessage: string
)

Source from the content-addressed store, hash-verified

319}
320
321async function parseUploadResponse(
322 response: Response,
323 fallbackMessage: string
324): Promise<UploadFileResponse> {
325 let data: { success?: boolean; error?: string; file?: UserFile } | null = null
326 try {
327 data = await response.json()
328 } catch {}
329
330 if (!response.ok || !data?.success) {
331 throw new Error(data?.error || `${fallbackMessage} (${response.status})`)
332 }
333 return data as UploadFileResponse
334}
335
336async function uploadWorkspaceFile(
337 workspaceId: string,

Callers 1

uploadViaApiFallbackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected