From 80dbd49c25b3facc7a8449fc7f2c2bf0c2560af4 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Thu, 11 May 2023 13:20:11 +0300 Subject: [PATCH] fix NaN --- apps/web/Components/Calculation/Form/ELT/Kasko.tsx | 9 ++++++++- apps/web/Components/Calculation/Form/ELT/Osago.tsx | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/web/Components/Calculation/Form/ELT/Kasko.tsx b/apps/web/Components/Calculation/Form/ELT/Kasko.tsx index b860b0d..16f9761 100644 --- a/apps/web/Components/Calculation/Form/ELT/Kasko.tsx +++ b/apps/web/Components/Calculation/Form/ELT/Kasko.tsx @@ -50,7 +50,14 @@ export function Kasko() { refetch() .then((res) => { if (res.data) { - const { key, kaskoSum, message, skCalcId, totalFranchise, requestId } = res.data; + const { + key, + kaskoSum = 0, + message, + skCalcId, + totalFranchise = 0, + requestId, + } = res.data; let { error } = res.data; if (totalFranchise > MAX_FRANCHISE) { diff --git a/apps/web/Components/Calculation/Form/ELT/Osago.tsx b/apps/web/Components/Calculation/Form/ELT/Osago.tsx index 3e6924c..c07653d 100644 --- a/apps/web/Components/Calculation/Form/ELT/Osago.tsx +++ b/apps/web/Components/Calculation/Form/ELT/Osago.tsx @@ -50,7 +50,7 @@ export function Osago() { refetch() .then((res) => { if (res.data) { - const { key, numCalc, premiumSum, message, skCalcId } = res.data; + const { key, numCalc, premiumSum = 0, message, skCalcId } = res.data; let { error } = res.data; if (premiumSum > MAX_INSURANCE) {