chore: fix UI

This commit is contained in:
2026-04-26 18:23:50 +02:00
parent 322882d587
commit a120ad6391
11 changed files with 317 additions and 44 deletions
+19 -3
View File
@@ -564,14 +564,14 @@ export const applyClientPenalty = async (
username: string,
points: number,
reason: string,
): Promise<{ success: boolean; error?: string }> => {
): Promise<{ success: boolean; compensated?: boolean; error?: string }> => {
try {
await apiClient.post(`${V2}/admin/protected/penalty`, {
const { data } = await apiClient.post(`${V2}/admin/protected/penalty`, {
username,
points,
reason,
});
return { success: true };
return { success: true, compensated: data?.compensated === true };
} catch (e: any) {
return { success: false, error: e.response?.data?.error || "Erreur" };
}
@@ -623,6 +623,22 @@ export const addClientPoints = async (
}
};
export const subtractClientPoints = async (
username: string,
poolKey: string,
points: number,
): Promise<{ success: boolean; error?: string }> => {
try {
await apiClient.post(
`${V2}/admin/protected/client/${username}/points/subtract`,
{ pool_key: poolKey, points },
);
return { success: true };
} catch (e: any) {
return { success: false, error: e.response?.data?.error || "Erreur" };
}
};
// ============================================
// ALERTES
// ============================================