refactoring: server actions data fetching -> api routes

This commit is contained in:
ner committed 2024-10-26 21:33:39 +03:00
1 parent 1111712d2c
commit 5cbf93b3b8
38 files changed
+326 -308

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ import { accountStates, updateAccountStates } from '@/api';
import { useFavorites, useFavoritesStateToggle, useWatchList, useWatchListStateToggle } from './useLocalUsersLists';
import { useSession } from './useSession';
import { KEY as USERS_SHOWS_KEY } from './useUsersShows';
import { KEY as USERS_SHOWS_KEY } from '@/api/queries/usersShows';
const KEY = ['show-state'];
@@ -50,7 +50,7 @@ export const useMutateShowState = (show: Show) => {
queryClient.setQueryData<ShowState>(key, snapshot);
},
onSuccess(_, { list, showType }) {
queryClient.invalidateQueries({ queryKey: USERS_SHOWS_KEY({ list, showType }), refetchType: 'all' });
queryClient.invalidateQueries({ queryKey: USERS_SHOWS_KEY({ list, showType, session }), refetchType: 'all' });
}
});