fix(frontend): query schemes by type

This commit is contained in:
2026-07-30 11:01:45 +08:00
parent 4596af7c12
commit 7745333a58
7 changed files with 62 additions and 30 deletions
@@ -127,12 +127,15 @@ const SchemeQuery: React.FC<Props> = ({
const handleQuery = async () => {
setLoading(true);
try {
const params: Record<string, string> = { network: NETWORK_NAME };
const params: Record<string, string> = {
network: NETWORK_NAME,
scheme_type: "burst_detection",
};
if (!queryAll && queryDate) {
params.query_date = queryDate.startOf("day").toISOString();
}
const response = await api.get("/api/v1/burst-detection/schemes/", { params });
const response = await api.get("/api/v1/schemes", { params });
const nextSchemes = response.data as BurstDetectionSchemeRecord[];
setSchemes(nextSchemes);
open?.({
@@ -154,8 +157,8 @@ const SchemeQuery: React.FC<Props> = ({
const handleViewSchemeResult = async (schemeName: string) => {
try {
const response = await api.get(
`/api/v1/burst-detection/schemes/${encodeURIComponent(schemeName)}`,
{ params: { network: NETWORK_NAME } },
`/api/v1/schemes/${encodeURIComponent(schemeName)}`,
{ params: { network: NETWORK_NAME, scheme_type: "burst_detection" } },
);
const schemeRecord = response.data as BurstDetectionSchemeRecord & {
result_payload?: BurstDetectionResult;