chore: fix
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -585,7 +585,8 @@ export interface ClientStats {
|
||||
telephone?: string;
|
||||
total_commands: number;
|
||||
points: number;
|
||||
points_zipette: number; // ✅ AJOUTER CETTE LIGNE
|
||||
pool_points: number[];
|
||||
pool_names: string[];
|
||||
penalties: number;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user