fix: statusable

This commit is contained in:
chenos 2021-05-10 15:58:14 +08:00
parent 797da5bdb0
commit 1b3e7993fb

View File

@ -62,7 +62,13 @@ export const getInfo = async (ctx: actions.Context, next) => {
}); });
if (view && view.type === 'form') { if (view && view.type === 'form') {
const statusable = !!ctx.db.getTable(view.collection_name).getField('status'); const count = await Field.count({
where: {
name: 'status',
collection_name: view.collection_name,
}
});
const statusable = !!count;//!!ctx.db.getTable(view.collection_name).getField('status');
if (statusable) { if (statusable) {
view.setDataValue('statusable', statusable); view.setDataValue('statusable', statusable);
} }