diff --git a/src/entities/history/api.ts b/src/entities/history/api.ts index c96e79a..fedaa81 100644 --- a/src/entities/history/api.ts +++ b/src/entities/history/api.ts @@ -3,6 +3,6 @@ import { cloudApiUrl } from '../../shared/config/env'; import type { HistoryRequest, HistoryResponse } from './types'; /** Запрашивает исторический ряд с avg-линией и min/max-диапазоном для графика. */ -export function getHistory(params: HistoryRequest): Promise { - return getJson(cloudApiUrl, '/history', params); +export function getHistory(params: HistoryRequest, signal?: AbortSignal): Promise { + return getJson(cloudApiUrl, '/history', params, { signal }); } diff --git a/src/features/edge-detail/components/ArchiveView.tsx b/src/features/edge-detail/components/ArchiveView.tsx index 0111966..9c5909d 100644 --- a/src/features/edge-detail/components/ArchiveView.tsx +++ b/src/features/edge-detail/components/ArchiveView.tsx @@ -254,7 +254,7 @@ export function ArchiveView({ {selectedTags.length ? ( ({ queryKey: ['history', edge, tag, from, to, granulate], - queryFn: () => getHistory({ edge, tag, from, to, granulate }), + queryFn: ({ signal }: { signal: AbortSignal }) => getHistory({ edge, tag, from, to, granulate }, signal), enabled, })), });