Skip to content

Commit

Permalink
Default only show activated contests in the contests API
Browse files Browse the repository at this point in the history
Not sure if we call this a BC change.
Closes: DOMjudge#2688
  • Loading branch information
vmcj committed Nov 16, 2024
1 parent ec356dd commit ed935c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/src/Controller/API/ContestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function addContestAction(Request $request): string
name: 'onlyActive',
description: 'Whether to only return data pertaining to contests that are active',
in: 'query',
schema: new OA\Schema(type: 'boolean', default: false)
schema: new OA\Schema(type: 'boolean', default: true)
)]
public function listAction(Request $request): Response
{
Expand Down Expand Up @@ -953,7 +953,7 @@ public function samplesDataZipAction(Request $request): Response
protected function getQueryBuilder(Request $request): QueryBuilder
{
try {
return $this->getContestQueryBuilder($request->query->getBoolean('onlyActive', false));
return $this->getContestQueryBuilder($request->query->getBoolean('onlyActive', true));
} catch (TypeError) {
throw new BadRequestHttpException('\'onlyActive\' must be a boolean.');
}
Expand Down

0 comments on commit ed935c6

Please sign in to comment.