fix(frontend): query schemes by type
This commit is contained in:
@@ -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
|
||||
? "没有找到任何方案"
|
||||
|
||||
Reference in New Issue
Block a user