logs-content: Added add post form
This commit is contained in:
@@ -5,10 +5,19 @@ const {postApi} = require("../../../../../rpdata/api/Post")
|
||||
module.exports = class {
|
||||
onCreate(input) {
|
||||
this.state = {
|
||||
log: input.log
|
||||
log: input.log,
|
||||
modal: null,
|
||||
}
|
||||
}
|
||||
|
||||
open(modal) {
|
||||
this.state.modal = modal
|
||||
}
|
||||
|
||||
close() {
|
||||
this.state.modal = null
|
||||
}
|
||||
|
||||
/**
|
||||
* Patch the posts
|
||||
*
|
||||
@@ -70,8 +79,13 @@ module.exports = class {
|
||||
})
|
||||
}
|
||||
|
||||
postEdited(post) {
|
||||
this.patch([post])
|
||||
postEdited(patch) {
|
||||
this.patch([patch])
|
||||
}
|
||||
|
||||
postAdded(post) {
|
||||
this.state.log.posts = this.state.log.posts.concat([post])
|
||||
this.state.log = Object.assign({}, this.state.log)
|
||||
}
|
||||
|
||||
get title() {
|
||||
|
||||
Reference in New Issue
Block a user