Skip to content

Commit

Permalink
Merge branch 'develop' into feat/access-bridge-service
Browse files Browse the repository at this point in the history
  • Loading branch information
kiremitrov123 authored Sep 19, 2024
2 parents df86b96 + c27a1e6 commit 4202042
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/hooks-react/src/series/useFirstEpisode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import type { Series } from '@jwp/ott-common/types/series';
import ApiService from '@jwp/ott-common/src/services/ApiService';
import { getModule } from '@jwp/ott-common/src/modules/container';
import { CACHE_TIME, STALE_TIME } from '@jwp/ott-common/src/constants';
import { useTranslation } from 'react-i18next';

export const useFirstEpisode = ({ series }: { series: Series | undefined }) => {
const apiService = getModule(ApiService);
const { i18n } = useTranslation();

const { isLoading, data } = useQuery(
['first-episode', series?.series_id],
async () => {
const item = await apiService.getEpisodes({ seriesId: series?.series_id, pageLimit: 1 });
const item = await apiService.getEpisodes({ seriesId: series?.series_id, pageLimit: 1, language: i18n.language });

return item?.episodes?.[0];
},
Expand Down

0 comments on commit 4202042

Please sign in to comment.