aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPytal <24800714+Pytal@users.noreply.github.com>2022-07-14 10:57:30 -0700
committerGitHub <noreply@github.com>2022-07-14 10:57:30 -0700
commit4832853f658a891fa16be6d770dedb093712f0bd (patch)
treee6390c6557428e4bf8b8e8bf86620a14a7bdd33d /apps
parent9671a8d5f89895fcb2a8d1d3f4e04d45ac00cd3e (diff)
parent0e7647c2ebbcac3251a365c0e44dcd2dfc142fab (diff)
downloadnextcloud-server-4832853f658a891fa16be6d770dedb093712f0bd.tar.gz
nextcloud-server-4832853f658a891fa16be6d770dedb093712f0bd.zip
Merge pull request #33222 from nextcloud/bugfix/noid/fix-translation-of-user-exists-error
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
})