Skip to content
Snippets Groups Projects
Commit bd8d5874 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

prevent undefined error & remove unexistent function

parent 37c38559
No related branches found
No related tags found
1 merge request!72REDMINE_ISSUE-11919
<template> <template>
<div class="fourteen wide column"> <div class="fourteen wide column">
<div <div :class="{ active: loading }" class="ui inverted dimmer">
:class="{active: loading}"
class="ui inverted dimmer"
>
<div class="ui text loader"> <div class="ui text loader">
Projet en cours de création. Vous allez être redirigé. Projet en cours de création. Vous allez être redirigé.
</div> </div>
...@@ -346,7 +343,7 @@ export default { ...@@ -346,7 +343,7 @@ export default {
postProjectThumbnail(projectSlug) { postProjectThumbnail(projectSlug) {
//* send img to the backend when feature_type is created //* send img to the backend when feature_type is created
if (this.isValidImage(this.fileToImport)) { if (this.fileToImport) {
let formData = new FormData(); let formData = new FormData();
formData.append("file", this.fileToImport); formData.append("file", this.fileToImport);
const url = const url =
...@@ -432,7 +429,7 @@ export default { ...@@ -432,7 +429,7 @@ export default {
this.loading = false; this.loading = false;
}) })
.catch((error) => { .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.errors.title.push(error.response.data.title[0]);
} }
this.loading = false; this.loading = false;
...@@ -455,7 +452,7 @@ export default { ...@@ -455,7 +452,7 @@ export default {
} }
}) })
.catch((error) => { .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.errors.title.push(error.response.data.title[0]);
} }
throw error; throw error;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment