diff --git a/client/coral-plugin-flags/FlagButton.js b/client/coral-plugin-flags/FlagButton.js
index ae6782d78..eeeb5e3f5 100644
--- a/client/coral-plugin-flags/FlagButton.js
+++ b/client/coral-plugin-flags/FlagButton.js
@@ -2,13 +2,17 @@ import React from 'react';
const name = 'coral-plugin-flags';
-const FlagButton = ({flag, item_id, postAction, currentUser, addNotification}) => {
- const flagged = flag && flag.includes(currentUser);
+const FlagButton = ({flag, id, postAction, addItem, updateItem, addNotification}) => {
+ const flagged = flag && flag.current_user;
const onFlagClick = () => {
- postAction(item_id, 'flag', currentUser);
+ postAction(id, 'flag', '123', 'comments')
+ .then((action) => {
+ addItem({...action, current_user:true}, 'actions');
+ updateItem(action.item_id, action.action_type, action.id, 'comments');
+ });
addNotification('success', 'Thank you for reporting this comment. Our moderation team has been notified and will review it shortly.');
-
};
+
return