Adopt TanStack Query
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 13m46s

This commit is contained in:
2026-01-10 10:43:13 -08:00
parent 6d468544e2
commit dcd9452b8c
31 changed files with 584 additions and 157 deletions

View File

@@ -1,6 +1,7 @@
// src/hooks/queries/useWatchedItemsQuery.ts
import { useQuery } from '@tanstack/react-query';
import * as apiClient from '../../services/apiClient';
import { queryKeys } from '../../config/queryKeys';
import type { MasterGroceryItem } from '../../types';
/**
@@ -19,7 +20,7 @@ import type { MasterGroceryItem } from '../../types';
*/
export const useWatchedItemsQuery = (enabled: boolean) => {
return useQuery({
queryKey: ['watched-items'],
queryKey: queryKeys.watchedItems(),
queryFn: async (): Promise<MasterGroceryItem[]> => {
const response = await apiClient.fetchWatchedItems();