mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-19 20:29:17 +00:00
fix: show translated error when sending media
This commit is contained in:
@@ -166,10 +166,14 @@ const MessageInput = ({ ticketStatus }) => {
|
|||||||
await api.post(`/messages/${ticketId}`, formData);
|
await api.post(`/messages/${ticketId}`, formData);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const errorMsg = err.response?.data?.error;
|
const errorMsg = err.response?.data?.error;
|
||||||
if (errorMsg === "ERR_SENDING_WAPP_MSG") {
|
if (errorMsg) {
|
||||||
toast.error(i18n.t("messagesInput.toasts.error"));
|
if (i18n.exists(`backendErrors.${errorMsg}`)) {
|
||||||
|
toast.error(i18n.t(`backendErrors.${errorMsg}`));
|
||||||
|
} else {
|
||||||
|
toast.error(err.response.data.error);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
toast.error(err.response.data.error);
|
toast.error("Unknown error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user