mirror of
https://github.com/hanzoai/sign.git
synced 2026-11-02 23:26:15 +00: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,
|
|
};
|
|
};
|