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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
454 B
TypeScript
Raw Normal View History

import type { IExecuteFunctions, ILoadOptionsFunctions, IDataObject } from 'n8n-workflow';
import type { IForm } from './FormInterface';
2020-04-04 07:04:25 -07:00
import { cockpitApiRequest } from './GenericFunctions';
export async function submitForm(
this: IExecuteFunctions | 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 await cockpitApiRequest.call(this, 'post', `/forms/submit/${resourceName}`, body);
2020-04-04 07:04:25 -07:00
}