From a7b6b7a03e27ba52597314c7cd8b80a914a8b362 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Sat, 9 Nov 2024 23:44:40 +0200 Subject: [PATCH] fix: company logo of the template --- .../webapp/src/containers/BrandingTemplates/_utils.ts | 11 +++++++---- packages/webapp/src/hooks/query/pdf-templates.ts | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/webapp/src/containers/BrandingTemplates/_utils.ts b/packages/webapp/src/containers/BrandingTemplates/_utils.ts index 7e7341141..3fc2fc129 100644 --- a/packages/webapp/src/containers/BrandingTemplates/_utils.ts +++ b/packages/webapp/src/containers/BrandingTemplates/_utils.ts @@ -48,6 +48,7 @@ export const useBrandingTemplateFormInitialValues = < const brandingAttributes = { templateName: pdfTemplate?.templateName, + companyLogoUri: pdfTemplate?.companyLogoUri, ...pdfTemplate?.attributes, }; return { @@ -56,14 +57,16 @@ export const useBrandingTemplateFormInitialValues = < }; }; -export const useBrandingState = (state?: Partial): BrandingState => { +export const useBrandingState = ( + state?: Partial, +): BrandingState => { const { brandingTemplateState } = useBrandingTemplateBoot(); return { ...brandingTemplateState, - ...state - } -} + ...state, + }; +}; export const getCustomizeDrawerNameFromResource = (resource: string) => { const pairs = { diff --git a/packages/webapp/src/hooks/query/pdf-templates.ts b/packages/webapp/src/hooks/query/pdf-templates.ts index 32660b920..992d0316c 100644 --- a/packages/webapp/src/hooks/query/pdf-templates.ts +++ b/packages/webapp/src/hooks/query/pdf-templates.ts @@ -38,6 +38,7 @@ export interface GetPdfTemplateValues {} export interface GetPdfTemplateResponse { templateName: string; + companyLogoUri?: string | null; attributes: Record; predefined: boolean; default: boolean;