Skip to content

Commit

Permalink
Endpoint to get configured card sets - closes #58.
Browse files Browse the repository at this point in the history
  • Loading branch information
Toxantron committed Jun 6, 2017
1 parent c454349 commit ca19852
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,22 @@ paths:
description: Boolean if the password was correct
schema:
$ref: '#/definitions/BoolResponse'
/session/cardsets:
get:
tags:
- session
summary: Get all configured cardsets
produces:
- application/json
responses:
'200':
description: Arrays with the face values of each card
schema:
type: array
items:
type: array
items:
type: string
'/session/cardset/{id}':
get:
tags:
Expand Down
7 changes: 7 additions & 0 deletions src/controllers/session-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ public function cardset($id)
$session = $this->getSession($id);
return $this->getCardSet($session);
}

// Get the card set of this session
// URL: /api/session/cardsets
public function cardsets()
{
return $this->cardSets;
}
}

return new SessionController($entityManager, $cardSets);

0 comments on commit ca19852

Please sign in to comment.