chore: fix
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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 };
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user