lml-main
Version:
This is now a mono repository published into many standalone packages.
23 lines (22 loc) • 1.08 kB
TypeScript
import { JobModel } from '@lml/cosmo-ts-data';
import { FormModel } from 'cosmoui';
/**
* The same form is used for cloning, editing and creating a job
* However the form has a "formType" which is either clone, edit or create
* The onSubmit handler for the form chooses which action to submit
* This is passed to the epic that handles each form submission differently
* ie a different http request is sent depending on if you are editing or creating
*/
export declare type JobFormType = 'clone' | 'edit' | 'create';
export declare const JOB_FORM_TYPE_CLONE: JobFormType;
export declare const JOB_FORM_TYPE_CREATE: JobFormType;
export declare const JOB_FORM_TYPE_EDIT: JobFormType;
export declare const SUBMIT_JOB_FORM = "SUBMIT_JOB_FORM";
export interface SubmitJobFormAction {
type: 'SUBMIT_JOB_FORM';
formData: FormModel;
jobFormType: JobFormType;
baseJob: JobModel;
}
export declare type JobFormAction = SubmitJobFormAction;
export declare const submitJobForm: (formData: FormModel, jobFormType: JobFormType, baseJob: JobModel) => SubmitJobFormAction;