mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Port plugins
This commit is contained in:
@@ -9,13 +9,11 @@ import {
|
||||
withSetCommentStatus,
|
||||
withBanUser,
|
||||
} from 'plugin-api/beta/client/hocs';
|
||||
import { getErrorMessages } from 'plugin-api/beta/client/utils';
|
||||
import BanUserDialog from '../components/BanUserDialog';
|
||||
|
||||
class BanUserDialogContainer extends React.Component {
|
||||
banUser = async () => {
|
||||
const {
|
||||
notify,
|
||||
authorId,
|
||||
commentId,
|
||||
commentStatus,
|
||||
@@ -25,23 +23,19 @@ class BanUserDialogContainer extends React.Component {
|
||||
banUser,
|
||||
} = this.props;
|
||||
|
||||
try {
|
||||
await banUser({
|
||||
id: authorId,
|
||||
message: '',
|
||||
await banUser({
|
||||
id: authorId,
|
||||
message: '',
|
||||
});
|
||||
|
||||
closeMenu();
|
||||
closeBanDialog();
|
||||
|
||||
if (commentStatus !== 'REJECTED') {
|
||||
await setCommentStatus({
|
||||
commentId: commentId,
|
||||
status: 'REJECTED',
|
||||
});
|
||||
|
||||
closeMenu();
|
||||
closeBanDialog();
|
||||
|
||||
if (commentStatus !== 'REJECTED') {
|
||||
await setCommentStatus({
|
||||
commentId: commentId,
|
||||
status: 'REJECTED',
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
notify('error', getErrorMessages(err));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user