Fix translation of user exists error server-side

Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
Christopher Ng 2022-09-01 19:00:48 +00:00
parent b9cd65291a
commit 8a15c629e2
4 changed files with 1 additions and 9 deletions

View File

@ -350,7 +350,7 @@ class UsersController extends AUserData {
if ($this->userManager->userExists($userid)) {
$this->logger->error('Failed addUser attempt: User already exists.', ['app' => 'ocs_api']);
throw new OCSException('User already exists', 102);
throw new OCSException($this->l10nFactory->get('provisioning_api')->t('User already exists'), 102);
}
if ($groups !== []) {

View File

@ -30,7 +30,6 @@ 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;
@ -553,13 +552,6 @@ 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
})