From 31251282ad24bb778cfa440c4091b91b1ad7db9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 23 Mar 2022 15:38:21 -0400 Subject: [PATCH] feat: delete flagId field from post/user on flag purge --- src/flags.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/flags.js b/src/flags.js index be8ba8856f..ee2d171b2d 100644 --- a/src/flags.js +++ b/src/flags.js @@ -493,6 +493,8 @@ Flags.purge = async function (flagIds) { ...assignedFlags.map(flagObj => ([`flags:byAssignee:${flagObj.assignee}`, flagObj.flagId])), ...userFlags.map(flagObj => ([`flags:byTargetUid:${flagObj.targetUid}`, flagObj.flagId])), ]), + db.deleteObjectFields(postFlags.map(flagObj => `post:${flagObj.targetId}`, ['flagId'])), + db.deleteObjectFields(userFlags.map(flagObj => `user:${flagObj.targetId}`, ['flagId'])), db.deleteAll([ ...flagIds.map(flagId => `flag:${flagId}`), ...flagIds.map(flagId => `flag:${flagId}:notes`),