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