feat(web): adminRequests cache key + staleTime polish

- qk.adminRequests defaults to status='all' when no filter is set; the unfiltered
  endpoint returns every status, so caching it as 'pending' was a latent mismatch.
- 60s staleTime on lidarrConfig + myRequests — both are session-stable enough
  that refetching on every consumer-page mount produced needless flicker.
This commit is contained in:
2026-04-29 20:04:51 -04:00
parent d7eaa189e2
commit ce7424219c
4 changed files with 10 additions and 5 deletions
+5 -2
View File
@@ -215,8 +215,11 @@ describe('qk admin keys', () => {
test('lidarrRootFolders key', () => {
expect(qk.lidarrRootFolders()).toEqual(['lidarrRootFolders']);
});
test('adminRequests key defaults to pending when status omitted', () => {
expect(qk.adminRequests()).toEqual(['adminRequests', { status: 'pending' }]);
test('adminRequests key uses "all" when status omitted', () => {
// listAdminRequests sends no status param when called without one (returns
// every status), so the cache key must distinguish that from any specific
// status — otherwise an unfiltered call would falsely cache as `pending`.
expect(qk.adminRequests()).toEqual(['adminRequests', { status: 'all' }]);
});
test('adminRequests key includes the status filter', () => {
expect(qk.adminRequests('approved')).toEqual([