diff --git a/apps/web/Components/Calculation/Form/ELT/Kasko.tsx b/apps/web/Components/Calculation/Form/ELT/Kasko.tsx index 413ae47..f3f3272 100644 --- a/apps/web/Components/Calculation/Form/ELT/Kasko.tsx +++ b/apps/web/Components/Calculation/Form/ELT/Kasko.tsx @@ -4,7 +4,6 @@ import { columns } from './lib/config'; import { makeEltKaskoRequest } from './lib/make-request'; import type { Row, StoreSelector } from './types'; import { getEltKasko } from '@/api/elt/query'; -import { STALE_TIME } from '@/constants/request'; import { MAX_FRANCHISE, MAX_INSURANCE, MIN_INSURANCE } from '@/constants/values'; import helper from '@/process/elt/lib/helper'; import { useStore } from '@/stores/hooks'; @@ -42,7 +41,6 @@ export const Kasko = observer(() => { const { id, key, name } = row; return { - cacheTime: 0, enabled: false, initialData: { ...initialData, id, key, name }, queryFn: async (context: QueryFunctionContext) => { @@ -60,7 +58,6 @@ export const Kasko = observer(() => { queryKey: ['elt', 'kasko', id], refetchOnWindowFocus: false, retry: false, - staleTime: STALE_TIME, }; }), }); @@ -77,7 +74,8 @@ export const Kasko = observer(() => { queries .filter(({ data }) => data?.key && kaskoCompanyIds.includes(data.key)) - .forEach(({ refetch, data }) => { + .forEach(({ refetch, data, remove }) => { + remove(); if (data?.key) $tables.elt.kasko.setRow({ key: data?.key, status: 'fetching' }); refetch() diff --git a/apps/web/Components/Calculation/Form/ELT/Osago.tsx b/apps/web/Components/Calculation/Form/ELT/Osago.tsx index cc40166..d53c77c 100644 --- a/apps/web/Components/Calculation/Form/ELT/Osago.tsx +++ b/apps/web/Components/Calculation/Form/ELT/Osago.tsx @@ -4,7 +4,6 @@ import { columns } from './lib/config'; import { makeEltOsagoRequest } from './lib/make-request'; import type { Row, StoreSelector } from './types'; import { getEltOsago } from '@/api/elt/query'; -import { STALE_TIME } from '@/constants/request'; import { MAX_INSURANCE, MIN_INSURANCE } from '@/constants/values'; import helper from '@/process/elt/lib/helper'; import { useStore } from '@/stores/hooks'; @@ -37,7 +36,6 @@ export const Osago = observer(() => { const { id, key, name } = row; return { - cacheTime: 0, enabled: false, initialData: { ...initialData, id, key, name }, queryFn: async (context: QueryFunctionContext) => { @@ -55,7 +53,6 @@ export const Osago = observer(() => { queryKey: ['elt', 'osago', id], refetchOnWindowFocus: false, retry: false, - staleTime: STALE_TIME, }; }), }); @@ -71,7 +68,8 @@ export const Osago = observer(() => { queries .filter(({ data }) => data?.key && osagoCompanyIds.includes(data?.key)) - .forEach(({ refetch, data }) => { + .forEach(({ refetch, data, remove }) => { + remove(); if (data?.key) $tables.elt.osago.setRow({ key: data?.key, status: 'fetching' }); refetch()