mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(Microsoft OneDrive Trigger Node): Fix issue with test run failing (#9386)
This commit is contained in:
parent
5a3122f279
commit
92a1d65c4b
|
@ -123,9 +123,11 @@ export class MicrosoftOneDriveTrigger implements INodeType {
|
|||
}) as string
|
||||
).replace('%21', '!');
|
||||
const folderPath = await getPath.call(this, folderId);
|
||||
responseData = responseData.filter((item: IDataObject) =>
|
||||
((item.parentReference as IDataObject).path as string).startsWith(folderPath),
|
||||
);
|
||||
|
||||
responseData = responseData.filter((item: IDataObject) => {
|
||||
const path = (item.parentReference as IDataObject)?.path as string;
|
||||
return typeof path === 'string' && path.startsWith(folderPath);
|
||||
});
|
||||
}
|
||||
responseData = responseData.filter((item: IDataObject) => item[eventResource]);
|
||||
if (!responseData?.length) {
|
||||
|
@ -146,11 +148,7 @@ export class MicrosoftOneDriveTrigger implements INodeType {
|
|||
}));
|
||||
}
|
||||
|
||||
if (this.getMode() === 'manual') {
|
||||
return [this.helpers.returnJsonArray(responseData[0])];
|
||||
} else {
|
||||
return [this.helpers.returnJsonArray(responseData)];
|
||||
}
|
||||
return [this.helpers.returnJsonArray(responseData)];
|
||||
} catch (error) {
|
||||
if (this.getMode() === 'manual' || !workflowData.lastTimeChecked) {
|
||||
throw error;
|
||||
|
|
Loading…
Reference in a new issue