Port plugins

This commit is contained in:
Chi Vinh Le
2018-01-23 20:06:55 +01:00
parent b196bb379a
commit 59cdc9fd5d
9 changed files with 39 additions and 68 deletions
@@ -1,23 +1,18 @@
import React from 'react';
import { compose } from 'react-apollo';
import { bindActionCreators } from 'redux';
import { getErrorMessages } from 'plugin-api/beta/client/utils';
import { notify } from 'plugin-api/beta/client/actions/notification';
import RejectCommentAction from '../components/RejectCommentAction';
import { connect, withSetCommentStatus } from 'plugin-api/beta/client/hocs';
class RejectCommentActionContainer extends React.Component {
rejectComment = async () => {
const { setCommentStatus, comment, hideMenu, notify } = this.props;
const { setCommentStatus, comment, hideMenu } = this.props;
try {
await setCommentStatus({
commentId: comment.id,
status: 'REJECTED',
});
} catch (err) {
notify('error', getErrorMessages(err));
}
await setCommentStatus({
commentId: comment.id,
status: 'REJECTED',
});
hideMenu();
};