Merge pull request #318 from w3nder/master

Update toastError showing ERROR message
This commit is contained in:
Cassio Santos
2021-12-09 06:49:22 -03:00
committed by GitHub

View File

@@ -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}`), {