Skip to content

Commit c451685

Browse files
committed
feat: add user to group endpoint
Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent 130e97e commit c451685

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

app/Http/Controllers/Api/OAuth2/OAuth2UserApiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ public function get($id)
336336
* @param $user_id
337337
* @return JsonResponse|mixed
338338
*/
339-
public function addUserToGroup($user_id): mixed
339+
public function updateUserGroups($user_id): mixed
340340
{
341341
return $this->processRequest(function() use($user_id) {
342342
if(!Request::isJson()) return $this->error400();

routes/api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
Route::group(['prefix' => '{id}'], function () {
3232
Route::get('', 'OAuth2UserApiController@get');
3333
Route::put('', 'OAuth2UserApiController@update');
34-
Route::put('groups', ['middleware' => 'service.account', 'uses' => 'OAuth2UserApiController@addUserToGroup']);
34+
Route::put('groups', ['middleware' => 'service.account', 'uses' => 'OAuth2UserApiController@updateUserGroups']);
3535
});
3636

3737
Route::group(['prefix' => 'me'], function () {

tests/OAuth2UserServiceApiTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function testGetAllWithoutFilter(){
106106
$this->assertTrue($page->total > 0);
107107
}
108108

109-
public function testAddUserToGroup(){
109+
public function testUpdateUserGroups(){
110110
$repo = EntityManager::getRepository(Group::class);
111111
$group = $repo->getOneBySlug('raw-users');
112112

@@ -128,7 +128,7 @@ public function testAddUserToGroup(){
128128

129129
$this->action(
130130
"PUT",
131-
"Api\OAuth2\OAuth2UserApiController@addUserToGroup",
131+
"Api\OAuth2\OAuth2UserApiController@updateUserGroups",
132132
$params,
133133
[],
134134
[],

0 commit comments

Comments
 (0)