This commit is contained in:
David Nguyen
2025-05-07 15:03:20 +10:00
parent 419bc02171
commit 7abfc9e271
390 changed files with 21254 additions and 12607 deletions

View File

@ -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}`
: '',
};
};