Browse Source

refactor(nocodb): remove unused comments

pull/5349/head
Wing-Kam Wong 2 years ago
parent
commit
4d1b99cb2d
  1. 24
      packages/nocodb/src/lib/models/HookLog.ts

24
packages/nocodb/src/lib/models/HookLog.ts

@ -24,8 +24,8 @@ export default class HookLog implements HookLogType {
response?: string; response?: string;
triggered_by?: string; triggered_by?: string;
constructor(hook: Partial<HookLog>) { constructor(hookLog: Partial<HookLog>) {
Object.assign(this, hook); Object.assign(this, hookLog);
} }
static async list( static async list(
@ -36,31 +36,11 @@ export default class HookLog implements HookLogType {
}, },
ncMeta = Noco.ncMeta 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, { const hookLogs = await ncMeta.metaList(null, null, MetaTable.HOOK_LOGS, {
condition: { condition: {
fk_hook_id: param.fk_hook_id, 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)); return hookLogs?.map((h) => new HookLog(h));
} }

Loading…
Cancel
Save