fix(error): update error mapper

This commit is contained in:
2025-02-06 14:28:39 +01:00
parent 4e9686d6a7
commit 1b39c438bf
2 changed files with 11 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
import {useLoadingSwitcher} from "../../../hooks/useLoading.jsx";
import {apiAxios} from "../../../utils/Tools.js";
import {apiAxios, errFormater} from "../../../utils/Tools.js";
import {toast} from "react-toastify";
import imageCompression from "browser-image-compression";
import {BirthDayField, CountryList, OptionField, RoleList, TextField} from "../../../components/MemberCustomFiels.jsx";
@@ -70,7 +70,7 @@ export function InformationForm({data}) {
toast.success('Profile mis à jours avec succès 🎉');
}).catch(e => {
console.log(e.response)
toast.error('Échec de la mise à jours du profile 😕 (code: ' + e.response.status + ')');
toast.error(errFormater(e,'Échec de la mise à jours du profile 😕'));
}).finally(() => {
if (setLoading)
setLoading(0)