n8n/packages/nodes-base/nodes/Cockpit/FormFunctions.ts

17 lines
516 B
TypeScript
Raw Normal View History

import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
2020-04-04 07:04:25 -07:00
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,
) {
2020-04-04 07:04:25 -07:00
const body: IForm = {
2020-10-22 06:46:03 -07:00
form,
2020-04-04 07:04:25 -07:00
};
return cockpitApiRequest.call(this, 'post', `/forms/submit/${resourceName}`, body);
}