From 196ae5e29cf545d9a3e4c346aca2c5de239939a2 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 23 Jan 2018 16:41:44 +0100 Subject: [PATCH] Notify on error (Communit > People) --- .../src/routes/Community/containers/People.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/client/coral-admin/src/routes/Community/containers/People.js b/client/coral-admin/src/routes/Community/containers/People.js index f8271b236..bd7fd2bac 100644 --- a/client/coral-admin/src/routes/Community/containers/People.js +++ b/client/coral-admin/src/routes/Community/containers/People.js @@ -16,6 +16,7 @@ import { appendNewNodes } from 'plugin-api/beta/client/utils'; import update from 'immutability-helper'; import { Spinner } from 'coral-ui'; import withQuery from 'coral-framework/hocs/withQuery'; +import { notifyOnMutationError, notifyOnDataError } from 'coral-framework/hocs'; class PeopleContainer extends React.Component { timer = null; @@ -84,10 +85,6 @@ class PeopleContainer extends React.Component { }; render() { - if (this.props.data.error) { - return
{this.props.data.error.message}
; - } - if (this.props.data.loading) { return (
@@ -204,6 +201,7 @@ export default compose( withSetUserRole, withUnsuspendUser, withUnbanUser, + notifyOnMutationError(['setUserRole', 'unsuspendUser', 'unbanUser']), withQuery( gql` query TalkAdmin_Community_People { @@ -239,5 +237,6 @@ export default compose( fetchPolicy: 'network-only', }, } - ) + ), + notifyOnDataError )(PeopleContainer);