@@ -154,17 +164,6 @@ class Home extends React.Component {
content="국내 디스코드봇들을 확인하고, 초대해보세요!"
/>
- {this.state.message ? (
-
- ) : (
- ''
- )}
-
카테고리로 빠르게 찾아보기:
{cats.map(r => (
<>
@@ -412,6 +411,11 @@ const messages = {
level: 'success',
title: '봇 신고 성공!',
message: '신고 내용이 관리자에게 전달되었습니다.'
+ },
+ delete: {
+ level: 'success',
+ title: '봇 삭제 성공!',
+ message: '봇이 삭제처리되셨습니다.'
}
}
diff --git a/src/routes/ManageBot.js b/src/routes/ManageBot.js
index 1a5ba54..f7d962a 100644
--- a/src/routes/ManageBot.js
+++ b/src/routes/ManageBot.js
@@ -13,7 +13,8 @@ import {
Image,
Button,
Popup,
- Table
+ Table,
+ Modal
} from 'semantic-ui-react'
import Redirect from '../components/Redirect'
import ReactMarkdown from 'react-markdown/with-html'
@@ -36,6 +37,7 @@ class ManageBot extends Component {
token: '',
owners: '',
ownersError: '',
+ delete: '',
info: { code: 0 },
data: { state: 0, data: {} }
}
@@ -144,6 +146,21 @@ class ManageBot extends Component {
else window.location.reload()
})
}
+
+ removeBot = async() => {
+ const token = localStorage.token,
+ id = localStorage.id,
+ date = localStorage.date
+ await fetch(config.api + '/bots/' + this.state.info.data.id, {
+ method: 'DELETE',
+ headers: { token, id, time: date }
+ })
+ .then(r => r.json())
+ .then(res => {
+ if (res.code !== 200) alert(res.message)
+ else window.location.href = '/?message=delete'
+ })
+ }
async componentDidMount() {
const res = await fetch(
config.api + '/bots/completeInfo/' + this.props.match.params.id,
@@ -450,10 +467,20 @@ class ManageBot extends Component {
봇을 삭제합니다
봇을 영구적으로 삭제합니다.
-
}
- />
+
} closeIcon>
+
+ {bot.name} 삭제하기
+
+
+
+ 봇을 삭제하시려면 {bot.name} 을 입력해주세요.
+
+
+ 봇을 삭제하시게되면 다시는 복구하실 수 없다는 점을 동의합니다.
+
+
+
)