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

This commit is contained in:
Jon 2024-05-16 11:33:35 +01:00 committed by GitHub
parent 5a3122f279
commit 92a1d65c4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -123,9 +123,11 @@ export class MicrosoftOneDriveTrigger implements INodeType {
}) as string }) as string
).replace('%21', '!'); ).replace('%21', '!');
const folderPath = await getPath.call(this, folderId); 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]); responseData = responseData.filter((item: IDataObject) => item[eventResource]);
if (!responseData?.length) { if (!responseData?.length) {
@ -146,11 +148,7 @@ export class MicrosoftOneDriveTrigger implements INodeType {
})); }));
} }
if (this.getMode() === 'manual') { return [this.helpers.returnJsonArray(responseData)];
return [this.helpers.returnJsonArray(responseData[0])];
} else {
return [this.helpers.returnJsonArray(responseData)];
}
} catch (error) { } catch (error) {
if (this.getMode() === 'manual' || !workflowData.lastTimeChecked) { if (this.getMode() === 'manual' || !workflowData.lastTimeChecked) {
throw error; throw error;