fix(fav-page): switch from static cacheKey to dynamic refreshDeps
- Replace the static `cacheKey` with `refreshDeps: [headers]` in the query configuration. - This ensures the cached data is automatically refreshed when the headers dependency changes, rather than relying on a static cache identifier.
This commit is contained in:
parent
191906192b
commit
f7b7216ef1
@ -39,7 +39,7 @@ export function FavePlayersPage() {
|
|||||||
const res = await fetch(`/api/fav`, { headers });
|
const res = await fetch(`/api/fav`, { headers });
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
return data;
|
return data;
|
||||||
}, { manual: true, cacheKey: 'favListRequest', cacheTime: 3 * 60 * 1000 });
|
}, { manual: true, refreshDeps: [headers], cacheTime: 3 * 60 * 1000 });
|
||||||
|
|
||||||
const list = useMemo(() => {
|
const list = useMemo(() => {
|
||||||
const l = showType === ShowType.LOCAL ? localList : favListRequest.data?.map(e => ({
|
const l = showType === ShowType.LOCAL ? localList : favListRequest.data?.map(e => ({
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user