n8n-nodes-base
Version:
Base nodes of n8n
23 lines • 939 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.addAlert = addAlert;
const transport_1 = require("../../../transport");
async function addAlert(index) {
const customerId = this.getNodeParameter('customerId', index);
const assetId = this.getNodeParameter('assetId', index);
const description = this.getNodeParameter('description', index);
const additionalFields = this.getNodeParameter('additionalFields', index);
const qs = {};
const requestMethod = 'POST';
const endpoint = 'rmm_alerts';
let body = {};
if (additionalFields) {
body = additionalFields;
}
body.customer_id = customerId;
body.asset_id = assetId;
body.description = description;
const responseData = await transport_1.apiRequest.call(this, requestMethod, endpoint, body, qs);
return this.helpers.returnJsonArray(responseData.alert);
}
//# sourceMappingURL=execute.js.map