mirror of
https://github.com/documenso/documenso.git
synced 2025-11-19 19:21:39 +10:00
fix: wip
This commit is contained in:
@ -1,13 +1,30 @@
|
||||
import type { TeamGlobalSettings } from '@prisma/client';
|
||||
import type { OrganisationGlobalSettings } from '@prisma/client';
|
||||
|
||||
import { NEXT_PUBLIC_WEBAPP_URL } from '../constants/app';
|
||||
|
||||
export const teamGlobalSettingsToBranding = (teamGlobalSettings: TeamGlobalSettings) => {
|
||||
export const teamGlobalSettingsToBranding = (
|
||||
settings: Omit<OrganisationGlobalSettings, 'id'>,
|
||||
teamId: number,
|
||||
) => {
|
||||
return {
|
||||
...teamGlobalSettings,
|
||||
...settings,
|
||||
brandingLogo:
|
||||
teamGlobalSettings.brandingEnabled && teamGlobalSettings.brandingLogo
|
||||
? `${NEXT_PUBLIC_WEBAPP_URL()}/api/branding/logo/team/${teamGlobalSettings.teamId}`
|
||||
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}`
|
||||
: '',
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user