We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4cfd29 commit 65dcb06Copy full SHA for 65dcb06
1 file changed
apps/sim/app/api/tools/file/manage/route.ts
@@ -54,11 +54,14 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
54
const selectedFileId =
55
fileId ||
56
(fileInput && typeof fileInput === 'object' && !Array.isArray(fileInput)
57
- ? typeof fileInput.id === 'string'
58
- ? fileInput.id
59
- : typeof fileInput.fileId === 'string'
60
- ? fileInput.fileId
61
- : ''
+ ? (() => {
+ const obj = fileInput as Record<string, unknown>
+ return typeof obj.id === 'string'
+ ? obj.id
+ : typeof obj.fileId === 'string'
62
+ ? obj.fileId
63
+ : ''
64
+ })()
65
: '')
66
67
if (!selectedFileId) {
0 commit comments