Skip to content

Commit

Permalink
Don't require user ID in user list endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
iansltx committed Apr 23, 2024
1 parent 41d2331 commit b3a5786
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ class UsersController extends BaseApiController
*/
public function getAction(Request $request, PDO $db): array|false
{
$userId = $this->getItemId($request, 'User not found');
try {
$userId = $this->getItemId($request, 'User not found');
} catch (\Exception) {
$userId = false;
}

// verbosity
$verbose = $this->getVerbosity($request);
Expand All @@ -37,7 +41,7 @@ public function getAction(Request $request, PDO $db): array|false
$start = $this->getStart($request);
$resultsperpage = $this->getResultsPerPage($request);

if (isset($request->url_elements[4])) {
if ($userId && isset($request->url_elements[4])) {
switch ($request->url_elements[4]) {
case 'talks':
$talkMapper = new TalkMapper($db, $request);
Expand Down

0 comments on commit b3a5786

Please sign in to comment.