chore: update

This commit is contained in:
2026-03-14 17:44:00 +01:00
parent 0043646cff
commit 0ae1529353
6 changed files with 360 additions and 7 deletions
+25
View File
@@ -591,6 +591,31 @@ export const getMyPenalties = async (): Promise<PenaltiesResponse> => {
}
};
// ============================================
// 👤 PROFIL CLIENT
// ============================================
export const getMyProfile = async (): Promise<{ success: boolean; client?: any; message?: string }> => {
try {
const { data } = await apiClient.get(`${V1}/profile`);
return { success: true, client: data.client };
} catch {
return { success: false, message: "Erreur récupération profil" };
}
};
export const updateMyProfile = async (fields: { nom?: string; prenom?: string; telephone?: string }): Promise<{ success: boolean; message?: string; client?: any }> => {
try {
const { data } = await apiClient.put(`${V1}/profile/update`, fields);
return { success: true, client: data.client, message: data.message };
} catch (error: any) {
return {
success: false,
message: error.response?.data?.error || error.response?.data?.message || "Erreur mise à jour profil",
};
}
};
// ============================================
// ORDER DETAILS
// ============================================