createKP: вывод ошибки из ответа сервера

This commit is contained in:
Chika 2022-12-08 11:59:43 +03:00
parent c8c7b15435
commit 024b6f6f71

View File

@ -89,13 +89,12 @@ export default async function (this: ICalculationStore) {
this.setOptions('selectQuote', quotes);
});
} catch (err) {
const { response } = err as AxiosError;
openNotification({
type: 'error',
message: 'Ошибка во время создания КП!',
description: response?.data?.message,
});
const { response } = err as AxiosError;
const error = response?.data || err;
throw JSON.stringify(error);
}
}