chore: add change password
This commit is contained in:
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user