Skip to content

Commit

Permalink
fix(Microsoft OneDrive Trigger Node): Fix issue with test run failing (
Browse files Browse the repository at this point in the history
  • Loading branch information
Joffcom committed May 16, 2024
1 parent 5a3122f commit 92a1d65
Showing 1 changed file with 6 additions and 8 deletions.
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

0 comments on commit 92a1d65

Please sign in to comment.