All files / app/src/entities/shipment-place/model get-shipments-place-collection-query.ts

41.17% Statements 7/17
100% Branches 0/0
0% Functions 0/1
41.17% Lines 7/17

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241x           1x 1x 1x 1x   1x   1x                    
import { queryFactory, QueryParams } from '@/shared/lib'
import { SHIPMENT_PLACE_COLLECTION_PRIMARY_KEY, ShipmentPlace } from '../lib'
import { CollectionResponse } from '@/shared/@types'
import { useRouter } from 'next/router'
import { queryFetchShipmentPlace } from './requests'
 
const getShipmentsPlaceCollectionQuery = queryFactory(
  SHIPMENT_PLACE_COLLECTION_PRIMARY_KEY,
  queryFetchShipmentPlace
)(filters => ({
  params: filters,
}))
 
export const useShipmentsPlaceCollection = (params?: QueryParams<CollectionResponse<ShipmentPlace>>) => {
  const { locale } = useRouter()
  return getShipmentsPlaceCollectionQuery.useHookInitializer({
    ...params,
    filters: {
      locale,
      ...params?.filters,
    },
  })
}