From 4d1b99cb2d76726bde4fb83183a0018738633b8f Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Fri, 24 Mar 2023 19:08:15 +0800 Subject: [PATCH] refactor(nocodb): remove unused comments --- packages/nocodb/src/lib/models/HookLog.ts | 24 ++--------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/packages/nocodb/src/lib/models/HookLog.ts b/packages/nocodb/src/lib/models/HookLog.ts index 09f18063af..e88e26202b 100644 --- a/packages/nocodb/src/lib/models/HookLog.ts +++ b/packages/nocodb/src/lib/models/HookLog.ts @@ -24,8 +24,8 @@ export default class HookLog implements HookLogType { response?: string; triggered_by?: string; - constructor(hook: Partial) { - Object.assign(this, hook); + constructor(hookLog: Partial) { + Object.assign(this, hookLog); } static async list( @@ -36,31 +36,11 @@ export default class HookLog implements HookLogType { }, ncMeta = Noco.ncMeta ) { - // todo: redis cache ?? - // let hooks = await NocoCache.getList(CacheScope.HOOK, [param.fk_model_id]); - // if (!hooks.length) { const hookLogs = await ncMeta.metaList(null, null, MetaTable.HOOK_LOGS, { condition: { fk_hook_id: param.fk_hook_id, - // ...(param.event ? { event: param.event?.toLowerCase?.() } : {}), - // ...(param.operation - // ? { operation: param.operation?.toLowerCase?.() } - // : {}) }, }); - // await NocoCache.setList(CacheScope.HOOK, [param.fk_model_id], hooks); - // } - // // filter event & operation - // if (param.event) { - // hooks = hooks.filter( - // h => h.event?.toLowerCase() === param.event?.toLowerCase() - // ); - // } - // if (param.operation) { - // hooks = hooks.filter( - // h => h.operation?.toLowerCase() === param.operation?.toLowerCase() - // ); - // } return hookLogs?.map((h) => new HookLog(h)); }