fix: SITE_URL
This commit is contained in:
1 parent
1fe912f4bd
commit
dfdfb79169
66 files changed
+1352
-240
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import movieAdvisor from '../clients/movieAdvisor';
|
||||
import mapMoviesSeriesResponseToShows from '../dto/Show';
|
||||
|
||||
export type UsersShowsQueryProps = {
|
||||
showType: Show['type'];
|
||||
list: 'favorite' | 'watchlist';
|
||||
session?: string | null;
|
||||
};
|
||||
|
||||
export const KEY = ({ list, showType, session }: UsersShowsQueryProps) => [`users-${list}`, showType, session];
|
||||
|
||||
const usersShowsQuery = ({ showType, list, session }: UsersShowsQueryProps) => ({
|
||||
suspense: true,
|
||||
queryKey: KEY({ list, showType, session }),
|
||||
initialPageParam: '1',
|
||||
queryFn: ({ pageParam = '1' }: { pageParam?: string }) =>
|
||||
movieAdvisor
|
||||
.get<TMDBPagination<Movie>>(`/account/null/${list}/${showType === 'tv' ? 'tv' : 'movies'}`, {
|
||||
params: { page: pageParam, sort_by: 'created_at.desc', session_id: session },
|
||||
preventCache: true
|
||||
})
|
||||
.then((response) => mapMoviesSeriesResponseToShows(response, showType))
|
||||
});
|
||||
|
||||
export default usersShowsQuery;
|
||||
Reference in new issue
Block a user