refactoring: server actions => tmdb proxy
This commit is contained in:
1 parent
dfdfb79169
commit
97d55b24a1
13 files changed
+131
-113
No files matched your search
@@ -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;
|
||||
Reference in new issue
Block a user