From c597584fa906ce93e1c8e70984709dafd577aa98 Mon Sep 17 00:00:00 2001 From: Henry Orozco Date: Fri, 27 Sep 2024 09:47:00 -0600 Subject: [PATCH] refactor: use codegen hook for useGetLibraryPlaylistPageDataQuery --- .../library/playlist/libraryPlaylistDetail.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/containers/library/playlist/libraryPlaylistDetail.tsx b/src/containers/library/playlist/libraryPlaylistDetail.tsx index 449149546..d10a294bc 100644 --- a/src/containers/library/playlist/libraryPlaylistDetail.tsx +++ b/src/containers/library/playlist/libraryPlaylistDetail.tsx @@ -1,4 +1,3 @@ -import { useQuery } from '@tanstack/react-query'; import { useRouter } from 'next/router'; import React from 'react'; @@ -6,17 +5,14 @@ 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 ;