Skip to content

Commit d9263c3

Browse files
fix(project): invalidate cache entries on deletion (#328)
1 parent fafceb5 commit d9263c3

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

apps/dashboard-api/src/controllers/project.controller.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,8 @@ module.exports.deleteProject = async (req, res) => {
22742274
}).select(
22752275
"+resources.storage.config.encrypted " +
22762276
"+resources.storage.config.iv " +
2277-
"+resources.storage.config.tag",
2277+
"+resources.storage.config.tag " +
2278+
"publishableKey secretKey",
22782279
);
22792280

22802281
if (!project) {
@@ -2320,6 +2321,11 @@ module.exports.deleteProject = async (req, res) => {
23202321

23212322
await MailTemplate.deleteMany({ projectId: project._id });
23222323
await Project.deleteOne({ _id: projectId });
2324+
2325+
await deleteProjectByApiKeyCache(project.publishableKey);
2326+
await deleteProjectByApiKeyCache(project.secretKey);
2327+
await deleteProjectById(project._id.toString());
2328+
23232329
storageRegistry.delete(projectId.toString());
23242330

23252331
res.json({

0 commit comments

Comments
 (0)