fix: auto get filter fields

This commit is contained in:
chenos 2021-03-25 16:54:11 +08:00
parent 330d08ab35
commit 2aa04323ff

View File

@ -384,6 +384,15 @@ export const getInfo = async (ctx: actions.Context, next) => {
data.groupField = groupField;
}
data.actions = data.actions.map(action => {
if (action.type === 'filter') {
if (!action.fields) {
action.fields = data.fields.filter(({filterable}) => filterable);
}
}
return action;
});
ctx.body = data;
await next();
};