chore: fix

This commit is contained in:
2026-03-14 15:28:40 +01:00
parent 9d52f3193a
commit 0043646cff
10 changed files with 156 additions and 77 deletions
+6 -1
View File
@@ -730,9 +730,11 @@ export interface PublicSettings {
points_enabled: boolean;
points_separated: boolean;
referral_enabled: boolean;
pool_names: string[];
}
export const getPublicSettings = async (): Promise<PublicSettings> => {
const defaults: PublicSettings = { penalties_enabled: true, show_amende_score: true, points_enabled: true, points_separated: true, referral_enabled: true, pool_names: ['Pool 1', 'Pool 2'] };
try {
const { data } = await apiClient.get(`${V1}/app-settings`);
return {
@@ -741,9 +743,12 @@ export const getPublicSettings = async (): Promise<PublicSettings> => {
points_enabled: data.points_enabled ?? true,
points_separated: data.points_separated ?? true,
referral_enabled: data.referral_enabled ?? true,
pool_names: Array.isArray(data.pool_names) && data.pool_names.length > 0
? data.pool_names
: defaults.pool_names,
};
} catch {
return { penalties_enabled: true, show_amende_score: true, points_enabled: true, points_separated: true, referral_enabled: true };
return defaults;
}
};