Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Microsoft OneDrive Trigger Node): Fix issue with test run failing #9386

Merged
merged 2 commits into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down
Loading