Last active
February 5, 2018 20:37
-
-
Save mitrallex/a9cc2a5a767fa83e5819b6ce336faee7 to your computer and use it in GitHub Desktop.
laravel-file-hosting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| endEditing(file) { | |
| this.editingFile = {}; | |
| let formData = new FormData(); | |
| formData.append('name', file.name); | |
| formData.append('type', file.type); | |
| formData.append('extension', file.extension); | |
| axios.post('files/edit/' + file.id, formData) | |
| .then(response => { | |
| if (response.data === true) { | |
| this.showNotification('Filename successfully changed!', true); | |
| var src = document.querySelector('[alt="' + file.name +'"]').getAttribute("src"); | |
| document.querySelector('[alt="' + file.name +'"]').setAttribute('src', src); | |
| } | |
| }) | |
| .catch(error => { | |
| this.errors = error.response.data.errors; | |
| this.showNotification(error.response.data.message, false); | |
| }); | |
| this.fetchFile(this.activeTab, this.pagination.current_page); | |
| }, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment