Centralize default user and team preferences. (#5172

Passing the fallback at each callpoint was dumb
This commit is contained in:
Tom Moor
2023-04-09 17:23:58 -04:00
committed by GitHub
parent 8324b03938
commit 2f9a56aa6f
11 changed files with 67 additions and 39 deletions

View File

@@ -1,9 +1,10 @@
import { TeamPreference } from "@shared/types";
import { Team } from "@server/models";
export default function presentPublicTeam(team: Team) {
return {
name: team.name,
avatarUrl: team.avatarUrl,
customTheme: team.preferences?.customTheme,
customTheme: team.getPreference(TeamPreference.CustomTheme),
};
}