chore: add change password

This commit is contained in:
2026-03-01 16:32:43 +01:00
parent 7b23f82355
commit e4020c6388
8 changed files with 261 additions and 7 deletions
+20
View File
@@ -507,6 +507,26 @@ export const cancelCommand = async (
// PENALTIES
// ============================================
export const changePassword = async (
currentPassword: string,
newPassword: string,
): Promise<{ success: boolean; message?: string }> => {
try {
await apiClient.put(`${V1}/auth/change-password`, {
current_password: currentPassword,
new_password: newPassword,
});
return { success: true };
} catch (error: any) {
return {
success: false,
message:
error.response?.data?.error ||
"Erreur lors du changement de mot de passe",
};
}
};
export const getMyPenalties = async (): Promise<PenaltiesResponse> => {
try {
const { data } = await apiClient.get(`${V1}/penalties`);