refactoring: server actions => tmdb proxy

This commit is contained in:
ner committed 2024-10-28 20:04:36 +02:00
1 parent dfdfb79169
commit 97d55b24a1
13 files changed
+131 -113

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import movieAdvisor from '../clients/movieAdvisor';
export type StatesQueryProps = { showId?: Show['id']; showType?: Show['type']; session?: string };
const statesQuery = ({ showId, showType, session }: StatesQueryProps) => ({
enabled: Boolean(showId),
queryKey: ['states', showId, showType, session],
staleTime: Infinity,
queryFn: () =>
movieAdvisor.get<ShowState>(`/${showType}/${showId}/account_states`, {
params: { session_id: session },
preventCache: true
})
});
export default statesQuery;