Browse Source

push label non-field error messages to ui

pull/418/head
Liam Cripwell 5 years ago
parent
commit
1a9d85cf12
1 changed files with 15 additions and 3 deletions
  1. 18
      app/server/static/components/label.vue

18
app/server/static/components/label.vue

@ -263,8 +263,14 @@ export default {
this.messages = [];
})
.catch((error) => {
console.log(error); // eslint-disable-line no-console
this.messages.push('You cannot use same label name or shortcut key.');
console.log(error);
if (error.response.data.non_field_errors) {
error.response.data.non_field_errors.forEach((msg) => {
this.messages.push(msg);
});
} else {
this.messages.push('You cannot use same label name or shortcut key.');
}
});
},
@ -312,7 +318,13 @@ export default {
})
.catch((error) => {
console.log(error); // eslint-disable-line no-console
this.messages.push('You cannot use same label name or shortcut key.');
if (error.response.data.non_field_errors) {
error.response.data.non_field_errors.forEach((msg) => {
this.messages.push(msg);
});
} else {
this.messages.push('You cannot use same label name or shortcut key.');
}
});
},

Loading…
Cancel
Save