chore: add push notif

This commit is contained in:
2026-03-14 18:28:02 +01:00
parent 0ae1529353
commit b1a41c4a16
5 changed files with 145 additions and 3 deletions
+16
View File
@@ -777,6 +777,22 @@ export const getPublicSettings = async (): Promise<PublicSettings> => {
}
};
export const registerPushToken = async (token: string): Promise<void> => {
try {
await apiClient.post(`${V1}/push-token`, { token });
} catch {
// silencieux
}
};
export const unregisterPushToken = async (): Promise<void> => {
try {
await apiClient.delete(`${V1}/push-token`);
} catch {
// silencieux
}
};
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)