mirror of
https://github.com/wassname/talk.git
synced 2026-08-14 12:50:17 +08:00
Port plugins
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user