mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: link pdf template to sales transactions
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { omit } from 'lodash';
|
||||
import { InvoiceCustomizeValues } from './types';
|
||||
import { CreatePdfTemplateValues, EditPdfTemplateValues } from '@/hooks/query/pdf-templates';
|
||||
|
||||
export const transformToEditRequest = (
|
||||
values: InvoiceCustomizeValues,
|
||||
templateId: number,
|
||||
): EditPdfTemplateValues => {
|
||||
return {
|
||||
templateId,
|
||||
templateName: 'Template Name',
|
||||
attributes: omit(values, ['templateName']),
|
||||
};
|
||||
};
|
||||
|
||||
export const transformToNewRequest = (
|
||||
values: InvoiceCustomizeValues,
|
||||
): CreatePdfTemplateValues => {
|
||||
return {
|
||||
resource: 'SaleInvoice',
|
||||
templateName: 'Template Name',
|
||||
attributes: omit(values, ['templateName']),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user