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
+21
View File
@@ -704,6 +704,27 @@ export const markNotificationsRead = async (): Promise<{
}
};
// ============================================
// PUBLIC SETTINGS
// ============================================
export interface PublicSettings {
penalties_enabled: boolean;
points_enabled: boolean;
}
export const getPublicSettings = async (): Promise<PublicSettings> => {
try {
const { data } = await apiClient.get(`${V1}/app-settings`);
return {
penalties_enabled: data.penalties_enabled ?? true,
points_enabled: data.points_enabled ?? true,
};
} catch {
return { penalties_enabled: true, points_enabled: true };
}
};
export const calculateOrderTotal = (order: any): number => {
if (typeof order.total === "number" && order.total > 0) return order.total;
if (typeof order.total_prix === "number" && order.total_prix > 0)