From 32c7138d8cf740056d4e58bfe8a71f56d5f44763 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 8 Jun 2023 16:47:26 +0530 Subject: [PATCH] fix: delete audit data on project delete Signed-off-by: Pranav C --- packages/nocodb/src/models/Project.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/models/Project.ts b/packages/nocodb/src/models/Project.ts index b062222f69..e08d5e036a 100644 --- a/packages/nocodb/src/models/Project.ts +++ b/packages/nocodb/src/models/Project.ts @@ -10,7 +10,7 @@ import NocoCache from '../cache/NocoCache'; import Base from './/Base'; import { ProjectUser } from './index'; import type { BoolType, MetaType, ProjectType } from 'nocodb-sdk'; -import type { DB_TYPES } from './/Base'; +import type { DB_TYPES } from './Base'; export default class Project implements ProjectType { public id: string; @@ -309,6 +309,11 @@ export default class Project implements ProjectType { `${CacheScope.PROJECT}:${projectId}`, CacheDelDirection.CHILD_TO_PARENT, ); + + await ncMeta.metaDelete(null, null, MetaTable.AUDIT, { + project_id: projectId, + }); + return await ncMeta.metaDelete(null, null, MetaTable.PROJECT, projectId); }