mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
improve actions handling & behavior
This commit is contained in:
parent
c512c97521
commit
80bde65a43
@ -184,13 +184,18 @@ export default class PostsFeed extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onDeletePost = async (data) => {
|
onDeletePost = async (data) => {
|
||||||
let result = await this.api.delete.post({ post_id: data._id }).catch(() => {
|
antd.Modal.confirm({
|
||||||
antd.message.error("Failed to delete post")
|
title: "Are you sure you want to delete this post?",
|
||||||
|
content: "This action is irreversible",
|
||||||
return false
|
okText: "Yes",
|
||||||
|
okType: "danger",
|
||||||
|
cancelText: "No",
|
||||||
|
onOk: async () => {
|
||||||
|
await this.api.delete.post({ post_id: data._id }).catch(() => {
|
||||||
|
antd.message.error("Failed to delete post")
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onDoubleClickPost = (data) => {
|
onDoubleClickPost = (data) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user