Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

// LocalController
['name' => 'Local#circles', 'url' => '/circles', 'verb' => 'GET'],
['name' => 'Local#probeCircles', 'url' => '/probecircles', 'verb' => 'GET'],
['name' => 'Local#create', 'url' => '/circles', 'verb' => 'POST'],
['name' => 'Local#destroy', 'url' => '/circles/{circleId}', 'verb' => 'DELETE'],
['name' => 'Local#search', 'url' => '/search', 'verb' => 'GET'],
Expand Down
28 changes: 28 additions & 0 deletions lib/Controller/LocalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,34 @@ public function circles(int $limit = -1, int $offset = 0): DataResponse {
}


/**
* @NoAdminRequired
*
* @param int $limit
* @param int $offset
*
* @return DataResponse
* @throws OCSException
*/
public function probeCircles(int $limit = -1, int $offset = 0): DataResponse {
try {
$this->setCurrentFederatedUser();

$probe = new CircleProbe();
$probe->filterHiddenCircles()
->filterBackendCircles()
->addDetail(BasicProbe::DETAILS_POPULATION)
->setItemsLimit($limit)
->setItemsOffset($offset);

return new DataResponse($this->serializeArray($this->circleService->probeCircles($probe)));
} catch (Exception $e) {
$this->e($e);
throw new OCSException($e->getMessage(), (int)$e->getCode());
}
}


/**
* @NoAdminRequired
*
Expand Down
Loading