Set 1 minute cache time on manual query fetches

This commit is contained in:
jeffvli 2023-01-06 03:33:11 -08:00
parent 8bd1cc80bc
commit 0a82438beb
8 changed files with 132 additions and 102 deletions

View file

@ -88,16 +88,19 @@ export const PlaylistListHeader = ({ tableRef }: PlaylistListHeaderProps) => {
...pageFilters,
});
const playlistsRes = await queryClient.fetchQuery(queryKey, async ({ signal }) =>
api.controller.getPlaylistList({
query: {
limit,
startIndex,
...pageFilters,
},
server,
signal,
}),
const playlistsRes = await queryClient.fetchQuery(
queryKey,
async ({ signal }) =>
api.controller.getPlaylistList({
query: {
limit,
startIndex,
...pageFilters,
},
server,
signal,
}),
{ cacheTime: 1000 * 60 * 1 },
);
const playlists = api.normalize.playlistList(playlistsRes, server);