mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-17 21:26:13 -04:00
21 lines
423 B
TypeScript
21 lines
423 B
TypeScript
import useApiQuery from 'Helpers/Hooks/useApiQuery';
|
|
import History from 'typings/History';
|
|
|
|
const DEFAULT_HISTORY: History[] = [];
|
|
|
|
const useEpisodeHistory = (episodeId: number) => {
|
|
const { data, ...result } = useApiQuery<History[]>({
|
|
path: '/history/episode',
|
|
queryParams: {
|
|
episodeId,
|
|
},
|
|
});
|
|
|
|
return {
|
|
data: data ?? DEFAULT_HISTORY,
|
|
...result,
|
|
};
|
|
};
|
|
|
|
export default useEpisodeHistory;
|