Skip to content

Commit

Permalink
fix double saving new posts
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Jan 9, 2019
1 parent 21307f7 commit 32ce64b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion public/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"/app.js": "/app.js?id=805ba942ea6e4c13438b",
"/app.js": "/app.js?id=3261b2da6aeec1f70422",
"/light.css": "/light.css?id=8e89114957501a2a2ff8",
"/dark.css": "/dark.css?id=9b71aa0a7c48cd60e734",
"/favicon.png": "/favicon.png?id=b0b34b4095fcdbb8942d"
Expand Down
6 changes: 3 additions & 3 deletions resources/js/screens/posts/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
fillForm(data) {
this.form.id = data.id;
this.form.publish_date = data.publish_date;
this.form.slug = 'draft-' + this.form.id;
if (this.id != 'new') {
this.form.title = data.title;
Expand Down Expand Up @@ -300,12 +301,11 @@
* Save the post.
*/
save() {
if (this.status) return;
this.errors = [];
this.status = 'Saving...';
this.form.slug = this.form.slug || 'draft-' + this.form.id;
this.form.title = this.form.title || 'Draft';
this.http().post('/api/posts/' + this.id, this.form).then(response => {
this.status = '';
Expand Down

0 comments on commit 32ce64b

Please sign in to comment.