Skip to content
Snippets Groups Projects
Commit 4f119460 authored by leandro's avatar leandro
Browse files

fix handle error thumbnail file

parent b901b8ed
No related branches found
No related tags found
1 merge request!41fix handle error thumbnail file
...@@ -53,7 +53,11 @@ ...@@ -53,7 +53,11 @@
name="thumbnail" name="thumbnail"
id="thumbnail" id="thumbnail"
/> />
<!-- {{ form.thumbnail.errors }} --> <ul v-if="errorThumbnail.length" id="errorlist-thumbnail" class="errorlist">
<li>
{{ errorThumbnail[0] }}
</li>
</ul>
</div> </div>
</div> </div>
<div class="field"> <div class="field">
...@@ -202,6 +206,7 @@ export default { ...@@ -202,6 +206,7 @@ export default {
access_level_pub_feature: [], access_level_pub_feature: [],
access_level_arch_feature: [], access_level_arch_feature: [],
}, },
errorThumbnail:[],
form: { form: {
title: "", title: "",
slug: "", slug: "",
...@@ -303,6 +308,10 @@ export default { ...@@ -303,6 +308,10 @@ export default {
} }
}) })
.catch((error) => { .catch((error) => {
let err_msg = "Transférez une image valide. Le fichier que vous avez transféré n'est pas une image, ou il est corrompu."
if (error.response.data[0])
err_msg = error.response.data[0]
this.errorThumbnail.push(err_msg);
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