fix(api): align frontend with REST contracts

This commit is contained in:
2026-07-30 20:38:52 +08:00
parent b57e58ff87
commit 782363cfb6
65 changed files with 99362 additions and 318 deletions
@@ -92,9 +92,7 @@ export const resolvePressureSamplingInterval = (items: ScadaInfoItem[]) => {
export const buildBurstDetectionRequest = (
parameters: BurstDetectionAnalysisParametersState,
network: string,
) => ({
network,
scheme_name: parameters.schemeName.trim(),
sampling_interval_minutes: parameters.samplingIntervalMinutes,
...(parameters.detectionMode === "historical" && parameters.targetTime
@@ -129,7 +127,7 @@ const AnalysisParameters: React.FC<Props> = ({
let active = true;
setFrequencyLoading(true);
api
.get("/api/v1/getallscadainfo/", { params: { network: NETWORK_NAME } })
.get("/api/v1/scada-info")
.then((response) => {
if (!active) return;
const interval = resolvePressureSamplingInterval(
@@ -186,8 +184,8 @@ const AnalysisParameters: React.FC<Props> = ({
try {
const response = await api.post(
"/api/v1/burst-detection/detect/",
buildBurstDetectionRequest(parametersState, NETWORK_NAME),
"/api/v1/burst-detections",
buildBurstDetectionRequest(parametersState),
);
onResult(response.data as BurstDetectionResult);
open?.({