Skip to content

Commit

Permalink
refactor: use codegen hook for useGetLibraryPlaylistPageDataQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
alangumer committed Sep 27, 2024
1 parent 921fa3c commit c597584
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/containers/library/playlist/libraryPlaylistDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import { useQuery } from '@tanstack/react-query';
import { useRouter } from 'next/router';
import React from 'react';

import NotFound from '~components/organisms/notFound';
import PlaylistDetail from '~containers/library/playlist/detail';
import LoadingCards from '~src/components/molecules/loadingCards';

import { getLibraryPlaylistPageData } from './__generated__/detail';
import { useGetLibraryPlaylistPageDataQuery } from './__generated__/detail';

function LibraryPlaylistDetail(): JSX.Element {
const router = useRouter();
const playlistId = router.query.playlist as string;

const { data, isLoading } = useQuery(
['getLibraryPlaylistPageData', { id: playlistId }],
() => getLibraryPlaylistPageData({ id: playlistId }),
{ staleTime: Infinity }
);
const { data, isLoading } = useGetLibraryPlaylistPageDataQuery({
id: playlistId,
});

if (isLoading) {
return <LoadingCards />;
Expand Down

0 comments on commit c597584

Please sign in to comment.