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