Browse Source

changes the returned key from UserID to id, in accordance with getUserData

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
tags/v17.0.0beta1
Arthur Schiwon 5 years ago
parent
commit
99075825e3
No account linked to committer's email address

+ 1
- 1
apps/provisioning_api/lib/Controller/UsersController.php View File

@@ -337,7 +337,7 @@ class UsersController extends AUserData {
}
}

return new DataResponse(['UserID' => $userid]);
return new DataResponse(['id' => $userid]);

} catch (HintException $e ) {
$this->logger->logException($e, [

+ 6
- 6
apps/provisioning_api/tests/Controller/UsersControllerTest.php View File

@@ -357,7 +357,7 @@ class UsersControllerTest extends TestCase {
->willReturn(true);

$this->assertTrue(key_exists(
'UserID',
'id',
$this->api->addUser('NewUser', 'PasswordOfTheNewUser')->getData()
));
}
@@ -417,7 +417,7 @@ class UsersControllerTest extends TestCase {
->with('NewUser', 'display', 'DisplayNameOfTheNewUser');

$this->assertTrue(key_exists(
'UserID',
'id',
$api->addUser('NewUser', 'PasswordOfTheNewUser', 'DisplayNameOfTheNewUser')->getData()
));
}
@@ -467,7 +467,7 @@ class UsersControllerTest extends TestCase {
->willReturnCallback(function() { return (string)rand(1000000000, 9999999999); });

$this->assertTrue(key_exists(
'UserID',
'id',
$this->api->addUser('', 'PasswordOfTheNewUser')->getData()
));
}
@@ -556,7 +556,7 @@ class UsersControllerTest extends TestCase {
->willReturn(true);

$this->assertTrue(key_exists(
'UserID',
'id',
$this->api->addUser('NewUser', 'PasswordOfTheNewUser')->getData()
));
}
@@ -617,7 +617,7 @@ class UsersControllerTest extends TestCase {
);

$this->assertTrue(key_exists(
'UserID',
'id',
$this->api->addUser('NewUser', 'PasswordOfTheNewUser', '', '', ['ExistingGroup'])->getData()
));
}
@@ -838,7 +838,7 @@ class UsersControllerTest extends TestCase {
->willReturn(true);

$this->assertTrue(key_exists(
'UserID',
'id',
$this->api->addUser('NewUser', 'PasswordOfTheNewUser', '', '', ['ExistingGroup1', 'ExistingGroup2'])->getData()
));
}

+ 4
- 4
settings/js/vue-settings-apps-users-management.js
File diff suppressed because it is too large
View File


+ 1
- 1
settings/js/vue-settings-apps-users-management.js.map
File diff suppressed because it is too large
View File


+ 1
- 1
settings/src/store/users.js View File

@@ -429,7 +429,7 @@ const actions = {
addUser({commit, dispatch}, { userid, password, displayName, email, groups, subadmin, quota, language }) {
return api.requireAdmin().then((response) => {
return api.post(OC.linkToOCS(`cloud/users`, 2), { userid, password, displayName, email, groups, subadmin, quota, language })
.then((response) => dispatch('addUserData', userid || response.data.ocs.data.UserID))
.then((response) => dispatch('addUserData', userid || response.data.ocs.data.id))
.catch((error) => {throw error;});
}).catch((error) => {
commit('API_FAILURE', { userid, error });

Loading…
Cancel
Save