Small improvements to ZohoCRM-Node and OAuth fix

This commit is contained in:
Jan Oberhauser
2020-02-14 18:48:58 -08:00
parent f938693695
commit 6a08fc9da3
6 changed files with 46 additions and 17 deletions

View File

@@ -80,12 +80,16 @@ export class ZohoCrm implements INodeType {
// }
responseData = await zohoApiRequest.call(this, 'POST', '/leads', body);
responseData = responseData.data;
} else {
throw new Error(`The operation "${operation}" is not known!`);
}
} else {
throw new Error(`The resource "${resource}" is not known!`);
}
if (Array.isArray(responseData)) {
returnData.push.apply(returnData, responseData as IDataObject[]);
} else {
} else if (responseData !== undefined) {
returnData.push(responseData as IDataObject);
}
}