Correctly return the group name
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
97dbaa26c4
commit
63089821a4
|
@ -160,7 +160,7 @@ class MetaData {
|
||||||
private function generateGroupMetaData(\OCP\IGroup $group, $userSearch) {
|
private function generateGroupMetaData(\OCP\IGroup $group, $userSearch) {
|
||||||
return array(
|
return array(
|
||||||
'id' => $group->getGID(),
|
'id' => $group->getGID(),
|
||||||
'name' => $group->getGID(),
|
'name' => $group->getDisplayName(),
|
||||||
'usercount' => $this->sorting === self::SORT_USERCOUNT ? $group->count($userSearch) : 0,
|
'usercount' => $this->sorting === self::SORT_USERCOUNT ? $group->count($userSearch) : 0,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ use OC\AppFramework\Http;
|
||||||
use OC\Group\MetaData;
|
use OC\Group\MetaData;
|
||||||
use OCP\AppFramework\Controller;
|
use OCP\AppFramework\Controller;
|
||||||
use OCP\AppFramework\Http\DataResponse;
|
use OCP\AppFramework\Http\DataResponse;
|
||||||
|
use OCP\IGroup;
|
||||||
use OCP\IGroupManager;
|
use OCP\IGroupManager;
|
||||||
use OCP\IL10N;
|
use OCP\IL10N;
|
||||||
use OCP\IRequest;
|
use OCP\IRequest;
|
||||||
|
@ -108,13 +109,9 @@ class GroupsController extends Controller {
|
||||||
Http::STATUS_CONFLICT
|
Http::STATUS_CONFLICT
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if($this->groupManager->createGroup($id)) {
|
$group = $this->groupManager->createGroup($id);
|
||||||
return new DataResponse(
|
if($group instanceof IGroup) {
|
||||||
array(
|
return new DataResponse(['groupname' => $group->getDisplayName()], Http::STATUS_CREATED);
|
||||||
'groupname' => $id
|
|
||||||
),
|
|
||||||
Http::STATUS_CREATED
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new DataResponse(
|
return new DataResponse(
|
||||||
|
@ -140,9 +137,7 @@ class GroupsController extends Controller {
|
||||||
return new DataResponse(
|
return new DataResponse(
|
||||||
array(
|
array(
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
'data' => array(
|
'data' => ['groupname' => $group->getDisplayName()]
|
||||||
'groupname' => $id
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
Http::STATUS_NO_CONTENT
|
Http::STATUS_NO_CONTENT
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue