Compiling js

parent 925e23f4
...@@ -94464,9 +94464,7 @@ exports.default = { ...@@ -94464,9 +94464,7 @@ exports.default = {
parentId: { type: Number } parentId: { type: Number }
}, },
data: function data() { data: function data() {
return { return {};
fileList: []
};
}, },
computed: { computed: {
...@@ -94483,7 +94481,6 @@ exports.default = { ...@@ -94483,7 +94481,6 @@ exports.default = {
methods: { methods: {
handleSuccess: function handleSuccess(response, file, fileList) { handleSuccess: function handleSuccess(response, file, fileList) {
this.$events.emit('fileWasUploaded', response); this.$events.emit('fileWasUploaded', response);
this.fileList = [];
}, },
uploadFile: function uploadFile(event) { uploadFile: function uploadFile(event) {
var _this = this; var _this = this;
...@@ -94492,8 +94489,13 @@ exports.default = { ...@@ -94492,8 +94489,13 @@ exports.default = {
data.append('parent_id', this.parentId); data.append('parent_id', this.parentId);
data.append('file', event.file); data.append('file', event.file);
_axios2.default.post(route('api.media.store'), data).then(function (response) { _axios2.default.post(route('api.media.store'), data).then(function (response) {
_this.fileList = [];
_this.$events.emit('fileWasUploaded', response); _this.$events.emit('fileWasUploaded', response);
}).catch(function (error) {
console.log(error.response.data);
_this.$notify.error({
title: 'Error',
message: error.response.data.errors.file[0]
});
}); });
}, },
handleRemove: function handleRemove() {} handleRemove: function handleRemove() {}
...@@ -94543,7 +94545,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c ...@@ -94543,7 +94545,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
"action": _vm.uploadUrl, "action": _vm.uploadUrl,
"on-remove": _vm.handleRemove, "on-remove": _vm.handleRemove,
"on-success": _vm.handleSuccess, "on-success": _vm.handleSuccess,
"file-list": _vm.fileList, "show-file-list": false,
"http-request": _vm.uploadFile "http-request": _vm.uploadFile
} }
}, [_c('el-button', { }, [_c('el-button', {
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