Bug: Fix error message when existing agent email is reused for a new agent (#538)

Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
ghosteathuman
2020-02-22 21:36:16 +08:00
committed by GitHub
parent 6340eb3ae2
commit 67f4f69e8a
4 changed files with 10 additions and 3 deletions

View File

@@ -128,7 +128,11 @@ export default {
this.showAlert(this.$t('AGENT_MGMT.ADD.API.SUCCESS_MESSAGE'));
this.onClose();
} catch (error) {
this.showAlert(this.$t('AGENT_MGMT.ADD.API.ERROR_MESSAGE'));
if (error.response.status === 422) {
this.showAlert(this.$t('AGENT_MGMT.ADD.API.EXIST_MESSAGE'));
} else {
this.showAlert(this.$t('AGENT_MGMT.ADD.API.ERROR_MESSAGE'));
}
}
},
},