chore: build backend frontend web
Frontend Web - Build & Lint / build (push) Has been cancelled
Backend - Build & Lint / build (push) Has been cancelled

This commit is contained in:
2026-06-20 20:14:18 +02:00
parent 26f4e75314
commit 74f3d4815e
5 changed files with 64 additions and 9 deletions
+9 -7
View File
@@ -92,9 +92,6 @@ export const extractUsernameFromToken = (): string | null => {
}
};
/**
* ✅ Synchroniser sessionStorage avec JWT
*/
export const syncUsernameFromJWT = (): string | null => {
const jwtUsername = extractUsernameFromToken();
@@ -2198,12 +2195,14 @@ export const getMyPointsRewards = async (): Promise<{
reward: PointsRewardConfig | null;
}> => {
const token = getAuthToken();
if (!token) return { success: false, enabled: false, pools: [], reward: null };
if (!token)
return { success: false, enabled: false, pools: [], reward: null };
try {
const response = await fetch(`${API_URL}/points/rewards`, {
headers: { Authorization: `Bearer ${token}` },
});
if (!response.ok) return { success: false, enabled: false, pools: [], reward: null };
if (!response.ok)
return { success: false, enabled: false, pools: [], reward: null };
const data = await safeJson(response);
return {
success: true,
@@ -2259,7 +2258,9 @@ export const getOrderRatingStatus = async (
}
};
export const claimMyReward = async (poolKey: string): Promise<{
export const claimMyReward = async (
poolKey: string,
): Promise<{
success: boolean;
description?: string;
remaining_rewards?: number;
@@ -2279,7 +2280,8 @@ export const claimMyReward = async (poolKey: string): Promise<{
body: JSON.stringify({ pool_key: poolKey }),
});
const data = await safeJson(response);
if (!response.ok) return { success: false, error: data.error || "Erreur" };
if (!response.ok)
return { success: false, error: data.error || "Erreur" };
return {
success: true,
description: data.description,