From a78a2192a688fab5e1ff2043a61303375ef02fe5 Mon Sep 17 00:00:00 2001 From: Wender Teixeira Date: Wed, 8 Dec 2021 23:25:06 -0300 Subject: [PATCH] Update toastError showing ERROR message --- frontend/src/errors/toastError.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/errors/toastError.js b/frontend/src/errors/toastError.js index 83fd728..9450764 100644 --- a/frontend/src/errors/toastError.js +++ b/frontend/src/errors/toastError.js @@ -2,7 +2,7 @@ import { toast } from "react-toastify"; import { i18n } from "../translate/i18n"; const toastError = err => { - const errorMsg = err.response?.data?.error; + const errorMsg = err.response?.data?.message || err.response.data.error; if (errorMsg) { if (i18n.exists(`backendErrors.${errorMsg}`)) { toast.error(i18n.t(`backendErrors.${errorMsg}`), {