summaryrefslogtreecommitdiff
path: root/src/store/modules/SecurityAndAccess/UserManagementStore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/modules/SecurityAndAccess/UserManagementStore.js')
-rw-r--r--src/store/modules/SecurityAndAccess/UserManagementStore.js21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/store/modules/SecurityAndAccess/UserManagementStore.js b/src/store/modules/SecurityAndAccess/UserManagementStore.js
index 362f3f64..78dbd433 100644
--- a/src/store/modules/SecurityAndAccess/UserManagementStore.js
+++ b/src/store/modules/SecurityAndAccess/UserManagementStore.js
@@ -113,10 +113,27 @@ const UserManagementStore = {
})
)
.catch((error) => {
- console.log(error);
- const message = i18n.t('pageUserManagement.toast.errorCreateUser', {
+ let message = i18n.t('pageUserManagement.toast.errorCreateUser', {
username,
});
+ if (error.response && error.response.data) {
+ if (error.response.data['UserName@Message.ExtendedInfo']) {
+ let obj = error.response.data['UserName@Message.ExtendedInfo'];
+ for (var key in obj) {
+ if (obj[key].Message) {
+ let msg = obj[key].Message;
+ if (msg.indexOf('already exists') != -1) {
+ message = i18n.t(
+ 'pageUserManagement.toast.errorAlreadyExistUser',
+ {
+ username,
+ }
+ );
+ }
+ }
+ }
+ }
+ }
throw new Error(message);
});
},