From 1b3e7993fb947e38591775c0bdda5a6bc5dfcc7b Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 10 May 2021 15:58:14 +0800 Subject: [PATCH] fix: statusable --- packages/plugin-pages/src/actions/views_v2.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugin-pages/src/actions/views_v2.ts b/packages/plugin-pages/src/actions/views_v2.ts index d104c7f11..4d50f3bb8 100644 --- a/packages/plugin-pages/src/actions/views_v2.ts +++ b/packages/plugin-pages/src/actions/views_v2.ts @@ -62,7 +62,13 @@ export const getInfo = async (ctx: actions.Context, next) => { }); 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) { view.setDataValue('statusable', statusable); }