1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00

cast in controller

This commit is contained in:
Robin Appelman 2017-08-07 22:57:44 +02:00
commit 54260646e0

View file

@ -71,23 +71,23 @@ class DemoController extends BaseController {
public function listDemos() { public function listDemos() {
$page = $this->query('page', 1); $page = $this->query('page', 1);
$order = $this->query('order', 'DESC') === 'ASC' ? 'ASC' : 'DESC'; $order = $this->query('order', 'DESC') === 'ASC' ? 'ASC' : 'DESC';
\Flight::json($this->demoListProvider->listDemos($page, $this->getFilter(), $order)); \Flight::json($this->demoListProvider->listDemos((int)$page, $this->getFilter(), $order));
} }
public function listProfile($steamId) { public function listProfile($steamId) {
$page = $this->query('page', 1); $page = $this->query('page', 1);
$where = $this->getFilter(); $where = $this->getFilter();
$where['players'][] = $steamId; $where['players'][] = $steamId;
\Flight::json($this->demoListProvider->listProfile($page, $where)); \Flight::json($this->demoListProvider->listProfile((int)$page, $where));
} }
public function listUploads($steamId) { public function listUploads($steamId) {
$page = $this->query('page', 1); $page = $this->query('page', 1);
\Flight::json($this->demoListProvider->listUploads($steamId, $page, $this->getFilter())); \Flight::json($this->demoListProvider->listUploads($steamId, (int)$page, $this->getFilter()));
} }
public function chat($demoId) { public function chat($demoId) {
\Flight::json($this->chatProvider->getChat($demoId)); \Flight::json($this->chatProvider->getChat((int)$demoId));
} }
public function setDemoUrl($id) { public function setDemoUrl($id) {