11import lodash from 'lodash'
22import { zeroAddress } from 'viem'
33import type { StoreApi } from 'zustand'
4- import { invalidateLoanExists } from '@/llamalend/queries/loan-exists'
54import type { FormStatus , FormValues } from '@/loan/components/PageLoanManage/LoanDecrease/types'
65import type { FormDetailInfo , FormEstGas } from '@/loan/components/PageLoanManage/types'
76import {
@@ -16,7 +15,7 @@ import { loadingLRPrices } from '@/loan/utils/utilsCurvejs'
1615import { getUserMarketCollateralEvents } from '@curvefi/prices-api/crvusd'
1716import { useWallet } from '@ui-kit/features/connect-wallet'
1817import { setMissingProvider } from '@ui-kit/utils/store.util'
19- import { getUserLoanDetails , invalidateUserLoanDetails } from '../entities/user-loan-details.query'
18+ import { getUserLoanDetails , invalidateAllUserBorrowDetails } from '../entities/user-loan-details.query'
2019
2120type StateKey = keyof typeof DEFAULT_STATE
2221const { cloneDeep } = lodash
@@ -217,10 +216,7 @@ const createLoanDecrease = (set: StoreApi<State>['setState'], get: StoreApi<Stat
217216 void getUserMarketCollateralEvents ( wallet ?. account ?. address , networks [ chainId ] . id , llamma . controller , resp . hash )
218217 if ( activeKey === get ( ) [ sliceKey ] . activeKey ) {
219218 await get ( ) . loans . fetchLoanDetails ( curve , llamma )
220-
221- const queryParams = { chainId, marketId : llamma . id , userAddress : wallet ?. account ?. address }
222- invalidateLoanExists ( queryParams )
223- invalidateUserLoanDetails ( queryParams )
219+ invalidateAllUserBorrowDetails ( { chainId, marketId : llamma . id , userAddress : wallet ?. account ?. address } )
224220
225221 get ( ) [ sliceKey ] . setStateByKey ( 'formStatus' , {
226222 ...get ( ) [ sliceKey ] . formStatus ,
0 commit comments