Fixing response structure on create

parent 121d3ac0
......@@ -169,20 +169,20 @@
methods: {
onSubmit() {
this.form = new Form(_.merge(this.page, {tags: this.tags}));
let vm = this;
this.loading = true;
this.form.post(route('api.page.page.store'))
.then(response => {
this.loading = false;
vm.$message({
this.$message({
type: 'success',
message: response.data.message
message: response.message
});
window.location = route('admin.page.page.index');
})
.catch(error => {
console.log(error);
this.loading = false;
vm.$notify.error({
this.$notify.error({
title: 'Error',
message: 'There are some errors in the form.'
});
......
......@@ -69947,18 +69947,18 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
var _this = this;
this.form = new __WEBPACK_IMPORTED_MODULE_3_form_backend_validation___default.a(_.merge(this.page, { tags: this.tags }));
var vm = this;
this.loading = true;
this.form.post(route('api.page.page.store')).then(function (response) {
_this.loading = false;
vm.$message({
_this.$message({
type: 'success',
message: response.data.message
message: response.message
});
window.location = route('admin.page.page.index');
}).catch(function (error) {
console.log(error);
_this.loading = false;
vm.$notify.error({
_this.$notify.error({
title: 'Error',
message: 'There are some errors in the form.'
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment