mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 06:58:07 -05:00
fix
This commit is contained in:
@@ -351,11 +351,19 @@ export const OneDriveBlock: BlockConfig<OneDriveResponse> = {
|
||||
params: (params) => {
|
||||
const { credential, folderId, fileId, mimeType, values, downloadFileName, ...rest } = params
|
||||
|
||||
// Handle values - could be string (from UI) or already parsed (from variable reference)
|
||||
let parsedValues
|
||||
try {
|
||||
parsedValues = values ? JSON.parse(values as string) : undefined
|
||||
} catch (error) {
|
||||
throw new Error('Invalid JSON format for values')
|
||||
if (values) {
|
||||
if (typeof values === 'string') {
|
||||
try {
|
||||
parsedValues = JSON.parse(values)
|
||||
} catch (error) {
|
||||
throw new Error('Invalid JSON format for values')
|
||||
}
|
||||
} else {
|
||||
// Already an object/array from variable reference
|
||||
parsedValues = values
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user