Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-07-20 13:36:07 +0300
committerGitHub <noreply@github.com>2022-07-20 13:36:07 +0300
commit08dabe975ec618d4da029a035f9b8d0038713a3b (patch)
tree1748fb7663d24084ae62a88646b142b72aa4c01a /apps
parentc1d75961430b947d1e5d43b7ca1500ba89720af9 (diff)
parent636ae8e829734ccfa6c4b76fbd89d666ade99e4d (diff)
Merge pull request #33262 from nextcloud/backport/33222/stable24
[stable24] Translate error when user already exists
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/src/store/index.js4
-rw-r--r--apps/settings/src/store/users.js8
2 files changed, 10 insertions, 2 deletions
diff --git a/apps/settings/src/store/index.js b/apps/settings/src/store/index.js
index 9d8733d430e..6689e4e5546 100644
--- a/apps/settings/src/store/index.js
+++ b/apps/settings/src/store/index.js
@@ -37,9 +37,9 @@ const mutations = {
API_FAILURE(state, error) {
try {
const message = error.error.response.data.ocs.meta.message
- showError(t('settings', 'An error occured during the request. Unable to proceed.') + '<br>' + message, { isHTML: true })
+ showError(t('settings', 'An error occurred during the request. Unable to proceed.') + '<br>' + message, { isHTML: true })
} catch (e) {
- showError(t('settings', 'An error occured during the request. Unable to proceed.'))
+ showError(t('settings', 'An error occurred during the request. Unable to proceed.'))
}
console.error(state, error)
},
diff --git a/apps/settings/src/store/users.js b/apps/settings/src/store/users.js
index ec15c8dd745..ce15fa4e87b 100644
--- a/apps/settings/src/store/users.js
+++ b/apps/settings/src/store/users.js
@@ -30,6 +30,7 @@ import api from './api'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import logger from '../logger'
+import { showError } from '@nextcloud/dialogs'
const orderGroups = function(groups, orderBy) {
/* const SORT_USERCOUNT = 1;
@@ -552,6 +553,13 @@ const actions = {
.then((response) => dispatch('addUserData', userid || response.data.ocs.data.id))
.catch((error) => { throw error })
}).catch((error) => {
+ const statusCode = error?.response?.data?.ocs?.meta?.statuscode
+
+ if (statusCode === 102) {
+ showError(t('settings', 'User already exists.'))
+ throw error
+ }
+
commit('API_FAILURE', { userid, error })
throw error
})