UNPKG

n8n-nodes-placid

Version:

n8n node to interact with Placid API for creative generation

36 lines 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.execute = execute; const n8n_workflow_1 = require("n8n-workflow"); async function execute(index) { try { const templateId = this.getNodeParameter('templateId', index); if (!templateId) { throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Template ID is required', { itemIndex: index, }); } const options = { method: 'DELETE', url: `https://api.placid.app/api/rest/templates/${templateId}`, headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, }; await this.helpers.httpRequestWithAuthentication.call(this, 'placidApi', options); return { json: { success: true, templateId, message: 'Template deleted successfully' }, }; } catch (error) { throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to delete template: ${error.message}`, { itemIndex: index, }); } } //# sourceMappingURL=delete.operation.js.map