mirror of
https://codeberg.org/demostf/api.git
synced 2026-06-03 18:04:08 +02:00
update flight
This commit is contained in:
parent
fef8fee6c9
commit
ae176a65e4
7 changed files with 47 additions and 23 deletions
|
|
@ -121,7 +121,7 @@ class DemoController extends BaseController {
|
|||
public function listDemos(): void {
|
||||
$page = (int) $this->query('page', '1');
|
||||
$order = 'ASC' === strtoupper($this->query('order', 'DESC')) ? 'ASC' : 'DESC';
|
||||
$this->json($this->demoListProvider->listDemos((int) $page, $this->getFilter(), $order));
|
||||
$this->json($this->demoListProvider->listDemos($page, $this->getFilter(), $order));
|
||||
}
|
||||
|
||||
public function listProfile(string $steamId): void {
|
||||
|
|
@ -129,13 +129,13 @@ class DemoController extends BaseController {
|
|||
$where = $this->getFilter();
|
||||
$where['players'][] = $steamId;
|
||||
$order = 'ASC' === $this->query('order', 'DESC') ? 'ASC' : 'DESC';
|
||||
$this->json($this->demoListProvider->listProfile((int) $page, $where, $order));
|
||||
$this->json($this->demoListProvider->listProfile($page, $where, $order));
|
||||
}
|
||||
|
||||
public function listUploads(string $steamId): void {
|
||||
$page = (int) $this->query('page', '1');
|
||||
$order = 'ASC' === $this->query('order', 'DESC') ? 'ASC' : 'DESC';
|
||||
$this->json($this->demoListProvider->listUploads($steamId, (int) $page, $this->getFilter(), $order));
|
||||
$this->json($this->demoListProvider->listUploads($steamId, $page, $this->getFilter(), $order));
|
||||
}
|
||||
|
||||
public function chat(string $demoId): void {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ $userController = new Controllers\UserController($container->getRequest(), $cont
|
|||
$infoController = new Controllers\InfoController($container->getRequest(), $container->getResponse(),
|
||||
$container->getInfoProvider());
|
||||
|
||||
Flight::set('flight.v2.output_buffering', true);
|
||||
|
||||
Flight::route('/*', function () {
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue