From cbeeffe805a8525f500b2dbc4e4c736ff42193eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 18 Jan 2021 18:52:24 -0300 Subject: [PATCH] Remove suffix from URL for user add operation --- packages/nodes-base/nodes/NextCloud/GenericFunctions.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts b/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts index 74bd134df0..3f5ca72b80 100644 --- a/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts +++ b/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts @@ -45,6 +45,13 @@ export async function nextCloudApiRequest(this: IHookFunctions | IExecuteFunctio }; options.uri = `${credentials.webDavUrl}/${encodeURI(endpoint)}`; + + const resource = this.getNodeParameter('resource', 0); + const operation = this.getNodeParameter('operation', 0); + + if (resource === 'user' && operation === 'add') { + options.uri = options.uri.replace('/remote.php/webdav', ''); + } console.log(options); return await this.helpers.request(options); } else {