Browse Source

Merge pull request #418 from liamcripwell/feature/label_nonfield_error_messages

Feature/label nonfield error messages
pull/443/head
Hiroki Nakayama 5 years ago
committed by GitHub
parent
commit
a7f7fae9e5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 2 deletions
  1. 16
      app/server/static/components/label.vue

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

@ -264,7 +264,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.');
}
});
},
@ -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