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
@@ -222,18 +222,18 @@ const SchemeQuery: React.FC<Props> = ({
const handleQuery = async () => {
setLoading(true);
try {
// API call to fetch schemes
// Adjust URL as needed
let url = `${config.BACKEND_URL}/api/v1/burst-location/schemes/`;
const params: Record<string, string> = { network: NETWORK_NAME };
const params: Record<string, string> = {
network: NETWORK_NAME,
scheme_type: "burst_location",
};
if (!queryAll && queryDate) {
params.query_date = queryDate.startOf("day").toISOString();
}
const [response, simulationResponse] = await Promise.all([
api.get(url, { params }),
api.get(`${config.BACKEND_URL}/api/v1/schemes`, { params }),
api.get(`${config.BACKEND_URL}/api/v1/schemes`, {
params: { network: NETWORK_NAME },
params: { network: NETWORK_NAME, scheme_type: "burst_analysis" },
}),
]);
const nextSchemes = response.data as BurstSchemeRecord[];
@@ -274,8 +274,8 @@ const SchemeQuery: React.FC<Props> = ({
const handleViewSchemeResult = async (schemeName: string) => {
try {
const response = await api.get(
`${config.BACKEND_URL}/api/v1/burst-location/schemes/${encodeURIComponent(schemeName)}`,
{ params: { network: NETWORK_NAME } },
`${config.BACKEND_URL}/api/v1/schemes/${encodeURIComponent(schemeName)}`,
{ params: { network: NETWORK_NAME, scheme_type: "burst_location" } },
);
const schemeRecord = response.data as BurstSchemeRecord & {
result_payload?: BurstLocationResult;