This commit is contained in:
Vikhyath Mondreti
2025-11-12 22:09:47 -08:00
parent 758352256c
commit f3d8acee7d

View File

@@ -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 {