Files
documenso/packages/lib/utils/team-global-settings-to-branding.ts
David Nguyen 7abfc9e271 fix: wip
2025-05-07 15:03:20 +10:00

31 lines
856 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,
) => {
return {
...settings,
brandingLogo:
settings.brandingEnabled && settings.brandingLogo
? `${NEXT_PUBLIC_WEBAPP_URL()}/api/branding/logo/team/${teamId}` // Todo: (orgs) Handle orgs
: '',
};
};
// Todo: (orgs) Handle orgs
export const organisationGlobalSettingsToBranding = (
settings: Omit<OrganisationGlobalSettings, 'id'>,
organisationId: string,
) => {
return {
...settings,
brandingLogo:
settings.brandingEnabled && settings.brandingLogo
? `${NEXT_PUBLIC_WEBAPP_URL()}/api/branding/logo/organisation/${organisationId}`
: '',
};
};