mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 08:13:39 +08:00
Make it possible for extensions to modify data before saving
This commit is contained in:
parent
6a46f3c1b1
commit
2069c7ab87
|
@ -27,13 +27,19 @@ export default class ComposerEdit extends ComposerBody {
|
|||
return items;
|
||||
}
|
||||
|
||||
onsubmit(content) {
|
||||
data() {
|
||||
return {
|
||||
content: this.content()
|
||||
};
|
||||
}
|
||||
|
||||
onsubmit() {
|
||||
var post = this.props.post;
|
||||
|
||||
this.loading(true);
|
||||
m.redraw();
|
||||
|
||||
post.save({content}).then(post => {
|
||||
post.save(this.data()).then(post => {
|
||||
app.composer.hide();
|
||||
m.redraw();
|
||||
}, response => {
|
||||
|
|
|
@ -19,16 +19,20 @@ export default class ComposerReply extends ComposerBody {
|
|||
return items;
|
||||
}
|
||||
|
||||
onsubmit(value) {
|
||||
data() {
|
||||
return {
|
||||
content: this.content(),
|
||||
links: {discussion: this.props.discussion}
|
||||
};
|
||||
}
|
||||
|
||||
onsubmit() {
|
||||
var discussion = this.props.discussion;
|
||||
|
||||
this.loading(true);
|
||||
m.redraw();
|
||||
|
||||
var data = {
|
||||
content: value,
|
||||
links: {discussion}
|
||||
};
|
||||
var data = this.data();
|
||||
|
||||
app.store.createRecord('posts').save(data).then((post) => {
|
||||
app.composer.hide();
|
||||
|
|
Loading…
Reference in New Issue
Block a user