mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
34 lines
936 B
TypeScript
34 lines
936 B
TypeScript
import type { OrganisationGlobalSettings } from '@prisma/client';
|
|
|
|
import { NEXT_PUBLIC_WEBAPP_URL } from '../constants/app';
|
|
|
|
export const teamGlobalSettingsToBranding = (
|
|
settings: Omit<OrganisationGlobalSettings, 'id'>,
|
|
teamId: number,
|
|
hidePoweredBy: boolean,
|
|
) => {
|
|
return {
|
|
...settings,
|
|
brandingLogo:
|
|
settings.brandingEnabled && settings.brandingLogo
|
|
? `${NEXT_PUBLIC_WEBAPP_URL()}/api/branding/logo/team/${teamId}`
|
|
: '',
|
|
brandingHidePoweredBy: hidePoweredBy,
|
|
};
|
|
};
|
|
|
|
export const organisationGlobalSettingsToBranding = (
|
|
settings: Omit<OrganisationGlobalSettings, 'id'>,
|
|
organisationId: string,
|
|
hidePoweredBy: boolean,
|
|
) => {
|
|
return {
|
|
...settings,
|
|
brandingLogo:
|
|
settings.brandingEnabled && settings.brandingLogo
|
|
? `${NEXT_PUBLIC_WEBAPP_URL()}/api/branding/logo/organisation/${organisationId}`
|
|
: '',
|
|
brandingHidePoweredBy: hidePoweredBy,
|
|
};
|
|
};
|