Adopt TanStack Query
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 13m46s
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 13m46s
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// src/hooks/queries/useBestSalePricesQuery.ts
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { fetchBestSalePrices } from '../../services/apiClient';
|
||||
import { queryKeys } from '../../config/queryKeys';
|
||||
import type { WatchedItemDeal } from '../../types';
|
||||
|
||||
/**
|
||||
@@ -19,7 +20,7 @@ import type { WatchedItemDeal } from '../../types';
|
||||
*/
|
||||
export const useBestSalePricesQuery = (enabled: boolean = true) => {
|
||||
return useQuery({
|
||||
queryKey: ['best-sale-prices'],
|
||||
queryKey: queryKeys.bestSalePrices(),
|
||||
queryFn: async (): Promise<WatchedItemDeal[]> => {
|
||||
const response = await fetchBestSalePrices();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user