mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
Add Cockpit node
This commit is contained in:
16
packages/nodes-base/nodes/Cockpit/FormFunctions.ts
Normal file
16
packages/nodes-base/nodes/Cockpit/FormFunctions.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions
|
||||
} from 'n8n-core';
|
||||
import { IDataObject } from 'n8n-workflow';
|
||||
import { IForm } from './FormInterface';
|
||||
import { cockpitApiRequest } from './GenericFunctions';
|
||||
|
||||
export async function submitForm(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, resourceName: string, form: IDataObject) {
|
||||
const body: IForm = {
|
||||
form: JSON.parse(form.toString())
|
||||
};
|
||||
|
||||
return cockpitApiRequest.call(this, 'post', `/forms/submit/${resourceName}`, body);
|
||||
}
|
||||
Reference in New Issue
Block a user