feat: delete flagId field from post/user on flag purge

isekai-main
Barış Soner Uşaklı 3 years ago
parent 03fdb5bede
commit 31251282ad

@ -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`),

Loading…
Cancel
Save