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