n8n/packages/nodes-base/nodes/Cockpit/FormFunctions.ts
कारतोफ्फेलस्क्रिप्ट™ 7a4e9ef5fa
refactor: Remove n8n-core dependency in nodes-base (no-changelog) (#5649)
2023-03-09 18:13:15 +01:00

21 lines
504 B
TypeScript

import type {
IExecuteFunctions,
IExecuteSingleFunctions,
ILoadOptionsFunctions,
IDataObject,
} from 'n8n-workflow';
import type { IForm } from './FormInterface';
import { cockpitApiRequest } from './GenericFunctions';
export async function submitForm(
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
resourceName: string,
form: IDataObject,
) {
const body: IForm = {
form,
};
return cockpitApiRequest.call(this, 'post', `/forms/submit/${resourceName}`, body);
}