Remove suffix from URL for user add operation

This commit is contained in:
Iván Ovejero 2021-01-18 18:52:24 -03:00
parent ebf81a887b
commit cbeeffe805

View file

@ -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 {