mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
fix deletion event
This commit is contained in:
parent
4da4583101
commit
19d8be3672
@ -21,9 +21,11 @@ export default class ExplorePosts extends React.Component {
|
||||
posts: [data, ...this.state.posts],
|
||||
})
|
||||
},
|
||||
"post.delete": async (data) => {
|
||||
"post.delete": async (id) => {
|
||||
this.setState({
|
||||
posts: this.state.posts.filter((post) => post.id !== data.id),
|
||||
posts: this.state.posts.filter((post) => {
|
||||
return post._id !== id
|
||||
}),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -32,9 +32,11 @@ export default class Feed extends React.Component {
|
||||
posts: [data, ...this.state.posts],
|
||||
})
|
||||
},
|
||||
"post.delete": async (data) => {
|
||||
"post.delete": async (id) => {
|
||||
this.setState({
|
||||
posts: this.state.posts.filter((post) => post.id !== data.id),
|
||||
posts: this.state.posts.filter((post) => {
|
||||
return post._id !== id
|
||||
}),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user