mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
fix: Pdf branding templates request data
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
} from '@/hooks/query/pdf-templates';
|
||||
import { useBrandingTemplateBoot } from './BrandingTemplateBoot';
|
||||
import { transformToForm } from '@/utils';
|
||||
import { BrandingTemplateValues } from './types';
|
||||
import { BrandingState, BrandingTemplateValues } from './types';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
const commonExcludedAttrs = ['templateName', 'companyLogoUri'];
|
||||
@@ -48,7 +48,7 @@ export const useBrandingTemplateFormInitialValues = <
|
||||
|
||||
const brandingAttributes = {
|
||||
templateName: pdfTemplate?.templateName,
|
||||
...brandingTemplateState,
|
||||
// ...brandingTemplateState,
|
||||
...pdfTemplate?.attributes,
|
||||
};
|
||||
return {
|
||||
@@ -57,6 +57,15 @@ export const useBrandingTemplateFormInitialValues = <
|
||||
};
|
||||
};
|
||||
|
||||
export const useBrandingState = (state?: Partial<BrandingState>): BrandingState => {
|
||||
const { brandingTemplateState } = useBrandingTemplateBoot();
|
||||
|
||||
return {
|
||||
...brandingTemplateState,
|
||||
...state
|
||||
}
|
||||
}
|
||||
|
||||
export const getCustomizeDrawerNameFromResource = (resource: string) => {
|
||||
const pairs = {
|
||||
SaleInvoice: DRAWERS.INVOICE_CUSTOMIZE,
|
||||
|
||||
Reference in New Issue
Block a user