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
@@ -152,9 +152,16 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
setLoading(true);
try {
const response = await api.get(
`${config.BACKEND_URL}/api/v1/schemes?network=${network}`,
);
const params: Record<string, string> = {
network,
scheme_type: SCHEME_TYPE,
};
if (!queryAll && queryDate) {
params.query_date = queryDate.startOf("day").toISOString();
}
const response = await api.get(`${config.BACKEND_URL}/api/v1/schemes`, {
params,
});
let filteredResults = response.data;
if (!queryAll) {
@@ -178,7 +185,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
if (filteredResults.length === 0) {
open?.({
type: "error",
type: "success",
message: "查询结果",
description: queryAll
? "没有找到任何方案"