mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 04:10:01 +00:00
⚡ Minor improvement to NextCloud Node
This commit is contained in:
@@ -19,8 +19,8 @@ import {
|
||||
export async function nextCloudApiRequest(this: IHookFunctions | IExecuteFunctions, method: string, endpoint: string, body: object | string | Buffer, headers?: object, encoding?: null | undefined, query?: object): Promise<any> { // tslint:disable-line:no-any
|
||||
const resource = this.getNodeParameter('resource', 0);
|
||||
const operation = this.getNodeParameter('operation', 0);
|
||||
|
||||
const options : OptionsWithUri = {
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
headers,
|
||||
method,
|
||||
body,
|
||||
|
||||
@@ -695,7 +695,6 @@ export class NextCloud implements INodeType {
|
||||
}
|
||||
|
||||
} else if (resource === 'user') {
|
||||
|
||||
if (operation === 'create') {
|
||||
// ----------------------------------
|
||||
// user:create
|
||||
@@ -774,7 +773,12 @@ export class NextCloud implements INodeType {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
resolve(data as IDataObject);
|
||||
|
||||
if (data.ocs.meta.status !== 'ok') {
|
||||
return reject(new Error(data.ocs.meta.message));
|
||||
}
|
||||
|
||||
resolve(data.ocs.data as IDataObject);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -841,7 +845,7 @@ export class NextCloud implements INodeType {
|
||||
if (resource === 'file' && operation === 'download') {
|
||||
// For file downloads the files get attached to the existing items
|
||||
return this.prepareOutputData(items);
|
||||
} else {
|
||||
} else {
|
||||
// For all other ones does the output get replaced
|
||||
return [this.helpers.returnJsonArray(returnData)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user