chore: fix

This commit is contained in:
2026-03-07 20:51:48 +01:00
parent 5c212e5f9c
commit 916d2a30ad
8 changed files with 316 additions and 194 deletions
+3 -1
View File
@@ -663,7 +663,9 @@ export const deleteCategoryAdmin = async (
export interface AppSettings {
penalties_enabled: boolean;
points_categories: string[];
points_enabled: boolean;
points_categories_weed: string[];
points_categories_zipette: string[];
points_separated: boolean;
}
+21
View File
@@ -339,3 +339,24 @@ export const getAllAlerts = async (): Promise<{
return { success: false, alerts: [], count: 0 };
}
};
// ============================================
// PARAMÈTRES PUBLICS
// ============================================
export interface PublicSettings {
penalties_enabled: boolean;
points_enabled: boolean;
}
export const getPublicSettings = async (): Promise<PublicSettings> => {
try {
const { data } = await apiClient.get(`http://5.181.0.112/api/v1/app-settings`);
return {
penalties_enabled: data.penalties_enabled ?? true,
points_enabled: data.points_enabled ?? true,
};
} catch {
return { penalties_enabled: true, points_enabled: true };
}
};