fix(frontend): query schemes by type
This commit is contained in:
@@ -262,9 +262,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;
|
||||
|
||||
@@ -292,7 +299,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
|
||||
|
||||
if (filteredResults.length === 0) {
|
||||
open?.({
|
||||
type: "error",
|
||||
type: "success",
|
||||
message: "未找到相关方案",
|
||||
description: "请尝试更改查询条件",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user