mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-08 05:31:39 +00:00
Refactor all api instances in components
This commit is contained in:
parent
bdd023fde3
commit
314bd766df
56 changed files with 879 additions and 755 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import { VirtualInfiniteGridRef } from '/@/renderer/components';
|
||||
import { AlbumArtistListHeader } from '/@/renderer/features/artists/components/album-artist-list-header';
|
||||
import { AnimatedPage } from '/@/renderer/features/shared';
|
||||
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
|
||||
|
|
@ -7,25 +6,29 @@ import { AlbumArtistListContent } from '/@/renderer/features/artists/components/
|
|||
import { useAlbumArtistList } from '/@/renderer/features/artists/queries/album-artist-list-query';
|
||||
import { generatePageKey, useAlbumArtistListFilter } from '/@/renderer/store';
|
||||
import { AlbumArtistListContext } from '/@/renderer/features/artists/context/album-artist-list-context';
|
||||
import { useCurrentServer } from '../../../store/auth.store';
|
||||
import { VirtualInfiniteGridRef } from '/@/renderer/components/virtual-grid';
|
||||
|
||||
const AlbumArtistListRoute = () => {
|
||||
const gridRef = useRef<VirtualInfiniteGridRef | null>(null);
|
||||
const tableRef = useRef<AgGridReactType | null>(null);
|
||||
const pageKey = generatePageKey('albumArtist', undefined);
|
||||
const server = useCurrentServer();
|
||||
|
||||
const albumArtistListFilter = useAlbumArtistListFilter({ id: undefined, key: pageKey });
|
||||
|
||||
const itemCountCheck = useAlbumArtistList(
|
||||
{
|
||||
const itemCountCheck = useAlbumArtistList({
|
||||
options: {
|
||||
cacheTime: 1000 * 60,
|
||||
staleTime: 1000 * 60,
|
||||
},
|
||||
query: {
|
||||
limit: 1,
|
||||
startIndex: 0,
|
||||
...albumArtistListFilter,
|
||||
},
|
||||
{
|
||||
cacheTime: 1000 * 60,
|
||||
staleTime: 1000 * 60,
|
||||
},
|
||||
);
|
||||
serverId: server?.id,
|
||||
});
|
||||
|
||||
const itemCount =
|
||||
itemCountCheck.data?.totalRecordCount === null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue