fix: error toast

This commit is contained in:
Emnaghz 2024-10-07 18:21:31 +01:00
parent 1d72732fad
commit 37b4629466

View File

@ -41,7 +41,11 @@ const TOAST_WARNING_STYLE = {
export const useToast = () => {
const { t } = useTranslation();
const extractErrorMessage = (error: any) => {
if (error?.statusCode == 409) {
if(typeof error === 'string') {
return error;
}
else if (error?.statusCode == 409) {
return t("message.duplicate_error");
}