mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-18 21:35:27 -04:00
25 lines
478 B
TypeScript
25 lines
478 B
TypeScript
import useApiQuery from 'Helpers/Hooks/useApiQuery';
|
|
import History from 'typings/History';
|
|
|
|
const DEFAULT_HISTORY: History[] = [];
|
|
|
|
const useSeriesHistory = (
|
|
seriesId: number,
|
|
seasonNumber: number | undefined
|
|
) => {
|
|
const { data, ...result } = useApiQuery<History[]>({
|
|
path: '/history/series',
|
|
queryParams: {
|
|
seriesId,
|
|
seasonNumber,
|
|
},
|
|
});
|
|
|
|
return {
|
|
data: data ?? DEFAULT_HISTORY,
|
|
...result,
|
|
};
|
|
};
|
|
|
|
export default useSeriesHistory;
|