From 61b54547334a726d3adfdd1e07c7632e896d9145 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Tue, 14 Jun 2022 18:47:26 +0800 Subject: [PATCH] fix: delete project: in cache for disable shared base --- packages/nocodb/src/lib/models/Project.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nocodb/src/lib/models/Project.ts b/packages/nocodb/src/lib/models/Project.ts index 682c5e642d..e47881f9d3 100644 --- a/packages/nocodb/src/lib/models/Project.ts +++ b/packages/nocodb/src/lib/models/Project.ts @@ -237,6 +237,7 @@ export default class Project implements ProjectType { let o = await NocoCache.get(key, CacheGetType.TYPE_OBJECT); if (o) { // update data + // new uuid is generated if (o.uuid && updateObj.uuid && o.uuid !== updateObj.uuid) { await NocoCache.del(`${CacheScope.PROJECT}:${o.uuid}`); await NocoCache.set( @@ -244,6 +245,10 @@ export default class Project implements ProjectType { projectId ); } + // disable shared base + if (o.uuid && updateObj.uuid === null) { + await NocoCache.del(`${CacheScope.PROJECT}:${o.uuid}`); + } if (o.title && updateObj.title && o.title !== updateObj.title) { await NocoCache.del(`${CacheScope.PROJECT}:${o.title}`); await NocoCache.set(