fix: handle error

This commit is contained in:
IlyaDoronin 2024-05-02 11:43:10 +03:00
parent 8d455f08cc
commit a1f0df3a69
2 changed files with 6 additions and 1 deletions

@ -190,7 +190,11 @@ function TariffPage() {
return; return;
} }
const [discounts] = await getDiscounts(userId); const [discounts, discountsError] = await getDiscounts(userId);
if (discountsError) {
throw new Error(discountsError);
}
if (discounts?.length) { if (discounts?.length) {
setDiscounts(discounts); setDiscounts(discounts);

@ -29,6 +29,7 @@ export function CheckFastlink() {
setDiscounts(discounts); setDiscounts(discounts);
} }
}; };
get(); get();
}, []); }, []);