mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #33262 from nextcloud/backport/33222/stable24
[stable24] Translate error when user already exists
This commit is contained in:
commit
08dabe975e
4 changed files with 13 additions and 5 deletions
|
|
@ -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)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
})
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue