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
) {
let hooks = await NocoCache.getList(CacheScope.HOOK, [param.fk_model_id]);
if (!hooks.length) {
const cachedList = await NocoCache.getList(CacheScope.HOOK, [
param.fk_model_id,
]);
let { list: hooks } = cachedList;
const { isEmptyList } = cachedList;
if (!isEmptyList && !hooks.length) {
hooks = await ncMeta.metaList(null, null, MetaTable.HOOKS, {
condition: {
fk_model_id: param.fk_model_id,

Loading…
Cancel
Save