Browse Source

refactor(nocodb): adopt getList new format in Hook.ts

pull/5430/head
Wing-Kam Wong 2 years ago
parent
commit
7b70191f1b
  1. 8
      packages/nocodb/src/lib/models/Hook.ts

8
packages/nocodb/src/lib/models/Hook.ts

@ -85,8 +85,12 @@ export default class Hook implements HookType {
}, },
ncMeta = Noco.ncMeta ncMeta = Noco.ncMeta
) { ) {
let hooks = await NocoCache.getList(CacheScope.HOOK, [param.fk_model_id]); const cachedList = await NocoCache.getList(CacheScope.HOOK, [
if (!hooks.length) { param.fk_model_id,
]);
let { list: hooks } = cachedList;
const { isEmptyList } = cachedList;
if (!isEmptyList && !hooks.length) {
hooks = await ncMeta.metaList(null, null, MetaTable.HOOKS, { hooks = await ncMeta.metaList(null, null, MetaTable.HOOKS, {
condition: { condition: {
fk_model_id: param.fk_model_id, fk_model_id: param.fk_model_id,

Loading…
Cancel
Save