diff --git a/src/views/project/Project_edit.vue b/src/views/project/Project_edit.vue index fe022fc8aeb804d78ad2337ac4957157016943ff..4d250f598a9afc0f5a2acfe376fa1954f074c213 100644 --- a/src/views/project/Project_edit.vue +++ b/src/views/project/Project_edit.vue @@ -1,9 +1,6 @@ <template> <div class="fourteen wide column"> - <div - :class="{active: loading}" - class="ui inverted dimmer" - > + <div :class="{ active: loading }" class="ui inverted dimmer"> <div class="ui text loader"> Projet en cours de création. Vous allez être redirigé. </div> @@ -346,7 +343,7 @@ export default { postProjectThumbnail(projectSlug) { //* send img to the backend when feature_type is created - if (this.isValidImage(this.fileToImport)) { + if (this.fileToImport) { let formData = new FormData(); formData.append("file", this.fileToImport); const url = @@ -432,7 +429,7 @@ export default { this.loading = false; }) .catch((error) => { - if (error.response.data.title[0]) { + if (error.response && error.response.data.title[0]) { this.errors.title.push(error.response.data.title[0]); } this.loading = false; @@ -455,7 +452,7 @@ export default { } }) .catch((error) => { - if (error.response.data.title[0]) { + if (error.response && error.response.data.title[0]) { this.errors.title.push(error.response.data.title[0]); } throw error;