Fix counts not decreasing on mutations

This commit is contained in:
Chi Vinh Le
2018-01-17 15:12:17 +01:00
parent 6aece16fd0
commit 519480c0e4
+2
View File
@@ -166,6 +166,7 @@ export default {
updateQueries: {
TalkAdmin_Community: prev => {
const updated = update(prev, {
flaggedUsernamesCount: { $apply: count => count - 1 },
flaggedUsers: {
nodes: { $apply: nodes => nodes.filter(node => node.id !== id) },
},
@@ -178,6 +179,7 @@ export default {
updateQueries: {
TalkAdmin_Community: prev => {
const updated = update(prev, {
flaggedUsernamesCount: { $apply: count => count - 1 },
flaggedUsers: {
nodes: {
$apply: nodes => nodes.filter(node => node.id !== userId),