mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 19:11:13 +00:00
🐛 Fix issue with empty folders on Nextcloud node #2057
This commit is contained in:
@@ -1104,34 +1104,38 @@ export class NextCloud implements INodeType {
|
|||||||
let skippedFirst = false;
|
let skippedFirst = false;
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
for (const item of jsonResponseData['d:multistatus']['d:response']) {
|
if (Array.isArray(jsonResponseData['d:multistatus']['d:response'])) {
|
||||||
if (skippedFirst === false) {
|
// @ts-ignore
|
||||||
skippedFirst = true;
|
for (const item of jsonResponseData['d:multistatus']['d:response']) {
|
||||||
continue;
|
if (skippedFirst === false) {
|
||||||
}
|
skippedFirst = true;
|
||||||
const newItem: IDataObject = {};
|
continue;
|
||||||
|
|
||||||
newItem.path = item['d:href'].slice(19);
|
|
||||||
|
|
||||||
const props = item['d:propstat'][0]['d:prop'];
|
|
||||||
|
|
||||||
// Get the props and save them under a proper name
|
|
||||||
for (const propName of Object.keys(propNames)) {
|
|
||||||
if (props[propName] !== undefined) {
|
|
||||||
newItem[propNames[propName]] = props[propName];
|
|
||||||
}
|
}
|
||||||
}
|
const newItem: IDataObject = {};
|
||||||
|
|
||||||
if (props['d:resourcetype'] === '') {
|
newItem.path = item['d:href'].slice(19);
|
||||||
newItem.type = 'file';
|
|
||||||
} else {
|
|
||||||
newItem.type = 'folder';
|
|
||||||
}
|
|
||||||
newItem.eTag = props['d:getetag'].slice(1, -1);
|
|
||||||
|
|
||||||
returnData.push(newItem as IDataObject);
|
const props = item['d:propstat'][0]['d:prop'];
|
||||||
|
|
||||||
|
// Get the props and save them under a proper name
|
||||||
|
for (const propName of Object.keys(propNames)) {
|
||||||
|
if (props[propName] !== undefined) {
|
||||||
|
newItem[propNames[propName]] = props[propName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (props['d:resourcetype'] === '') {
|
||||||
|
newItem.type = 'file';
|
||||||
|
} else {
|
||||||
|
newItem.type = 'folder';
|
||||||
|
}
|
||||||
|
newItem.eTag = props['d:getetag'].slice(1, -1);
|
||||||
|
|
||||||
|
returnData.push(newItem as IDataObject);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
returnData.push(responseData as IDataObject);
|
returnData.push(responseData as IDataObject);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user