@@ -45,55 +45,55 @@ export const Company_Name = async (): Promise<IConfigs["company"]["name"]> =>
4545{
4646 const configs = await ConfigModel . findOne ( ) ;
4747 if ( ! configs ) throw new Error ( "No configs found" ) ;
48- return configs . company ?. name ?? process . env . COMPANY_NAME ?? "" ;
48+ return ( configs . company ?. name === "" ? undefined : configs . company ?. name ) ?? process . env . COMPANY_NAME ?? "" ;
4949} ;
5050export const Company_Address = async ( ) : Promise < IConfigs [ "company" ] [ "address" ] > =>
5151{
5252 const configs = await ConfigModel . findOne ( ) ;
5353 if ( ! configs ) throw new Error ( "No configs found" ) ;
54- return configs . company ?. address ?? process . env . COMPANY_ADDRESS ?? "" ;
54+ return ( configs . company ?. address === "" ? undefined : configs . company ?. address ) ?? process . env . COMPANY_ADDRESS ?? "" ;
5555}
5656export const Company_Zip = async ( ) : Promise < IConfigs [ "company" ] [ "zip" ] > =>
5757{
5858 const configs = await ConfigModel . findOne ( ) ;
5959 if ( ! configs ) throw new Error ( "No configs found" ) ;
60- return configs . company ?. zip ?? process . env . COMPANY_ZIP ?? "" ;
60+ return ( configs . company ?. zip === "" ? undefined : configs . company ?. zip ) ?? process . env . COMPANY_ZIP ?? "" ;
6161}
6262export const Company_City = async ( ) : Promise < IConfigs [ "company" ] [ "city" ] > =>
6363{
6464 const configs = await ConfigModel . findOne ( ) ;
6565 if ( ! configs ) throw new Error ( "No configs found" ) ;
66- return configs . company ?. city ?? process . env . COMPANY_CITY ?? "" ;
66+ return ( configs . company ?. city === "" ? undefined : configs . company ?. city ) ?? process . env . COMPANY_CITY ?? "" ;
6767}
6868export const Company_Country = async ( ) : Promise < IConfigs [ "company" ] [ "country" ] > =>
6969{
7070 const configs = await ConfigModel . findOne ( ) ;
7171 if ( ! configs ) throw new Error ( "No configs found" ) ;
72- return configs . company ?. country ?? process . env . COMPANY_COUNTRY ?? "" ;
72+ return ( configs . company ?. country === "" ? undefined : configs . company ?. country ) ?? process . env . COMPANY_COUNTRY ?? "" ;
7373}
7474export const Company_Phone = async ( ) : Promise < IConfigs [ "company" ] [ "phone" ] > =>
7575{
7676 const configs = await ConfigModel . findOne ( ) ;
7777 if ( ! configs ) throw new Error ( "No configs found" ) ;
78- return configs . company ?. phone ?? process . env . COMPANY_PHONE ?? "" ;
78+ return ( configs . company ?. phone === "" ? undefined : configs . company ?. phone ) ?? process . env . COMPANY_PHONE ?? "" ;
7979}
8080export const Company_Email = async ( ) : Promise < IConfigs [ "company" ] [ "email" ] > =>
8181{
8282 const configs = await ConfigModel . findOne ( ) ;
8383 if ( ! configs ) throw new Error ( "No configs found" ) ;
84- return configs . company ?. email ?? process . env . COMPANY_EMAIL ?? "" ;
84+ return ( configs . company ?. email === "" ? undefined : configs . company ?. email ) ?? process . env . COMPANY_EMAIL ?? "" ;
8585}
8686export const Company_Vat = async ( ) : Promise < IConfigs [ "company" ] [ "vat" ] > =>
8787{
8888 const configs = await ConfigModel . findOne ( ) ;
8989 if ( ! configs ) throw new Error ( "No configs found" ) ;
90- return configs . company ?. vat ?? process . env . COMPANY_VAT ?? "" ;
90+ return ( configs . company ?. vat === "" ? undefined : configs . company ?. vat ) ?? process . env . COMPANY_VAT ?? "" ;
9191}
9292export const Company_Currency = async ( ) : Promise < IConfigs [ "company" ] [ "currency" ] > =>
9393{
9494 const configs = await ConfigModel . findOne ( ) ;
9595 if ( ! configs ) throw new Error ( "No configs found" ) ;
96- return configs . company ?. currency ?? process . env . COMPANY_CURRENCY ?? "" ;
96+ return ( configs . company ?. currency === "" ? undefined : configs . company ?. currency ) ?? process . env . COMPANY_CURRENCY ?? "" ;
9797}
9898export const Company_Tax_Registered = async ( ) : Promise < IConfigs [ "company" ] [ "tax_registered" ] > =>
9999{
@@ -105,13 +105,13 @@ export const Company_Logo_Url = async (): Promise<IConfigs["company"]["logo_url"
105105{
106106 const configs = await ConfigModel . findOne ( ) ;
107107 if ( ! configs ) throw new Error ( "No configs found" ) ;
108- return configs . company ?. logo_url ?? process . env . COMPANY_LOGO_URL ?? "" ;
108+ return ( configs . company ?. logo_url === "" ? undefined : configs . company ?. logo_url ) ?? process . env . COMPANY_LOGO_URL ?? "" ;
109109}
110110export const Company_Website = async ( ) : Promise < IConfigs [ "company" ] [ "website" ] > =>
111111{
112112 const configs = await ConfigModel . findOne ( ) ;
113113 if ( ! configs ) throw new Error ( "No configs found" ) ;
114- return configs . company ?. website ?? process . env . COMPANY_WEBSITE ?? "" ;
114+ return ( configs . company ?. website === "" ? undefined : configs . company ?. website ) ?? process . env . COMPANY_WEBSITE ?? "" ;
115115}
116116
117117export const Default_Language : keyof IAllLanguages = (
0 commit comments