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

ordering for profile and uploads

This commit is contained in:
Robin Appelman 2020-12-09 23:39:17 +01:00
commit 750de60257
2 changed files with 8 additions and 6 deletions

View file

@ -120,12 +120,14 @@ class DemoController extends BaseController {
$page = (int) $this->query('page', '1');
$where = $this->getFilter();
$where['players'][] = $steamId;
$this->json($this->demoListProvider->listProfile((int) $page, $where));
$order = 'ASC' === $this->query('order', 'DESC') ? 'ASC' : 'DESC';
$this->json($this->demoListProvider->listProfile((int) $page, $where, $order));
}
public function listUploads(string $steamId): void {
$page = (int) $this->query('page', '1');
$this->json($this->demoListProvider->listUploads($steamId, (int) $page, $this->getFilter()));
$order = 'ASC' === $this->query('order', 'DESC') ? 'ASC' : 'DESC';
$this->json($this->demoListProvider->listUploads($steamId, (int) $page, $this->getFilter(), $order));
}
public function chat(string $demoId): void {