Skip to content

Commit

Permalink
chore: unit test update, and size parameter update
Browse files Browse the repository at this point in the history
  • Loading branch information
benborla committed Nov 18, 2023
1 parent 66982cd commit 87ab3d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions api/src/Controller/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Controller;

use App\Pagination\Paginator;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -13,8 +14,8 @@ final class IndexController extends AbstractController
#[Route('/', name: 'fruits', methods: ['GET'])]
public function all(Request $request, FruitRepository $fruits): JsonResponse
{
$page = (int) $request->get('page');
$size = (int) $request->get('size');
$page = (int) $request->get('page', 1);
$size = (int) $request->get('size', Paginator::PAGE_SIZE) ?: Paginator::PAGE_SIZE;
$orderBy = $request->get('order_by', 'name');
$search = $request->get('search');
$direction = $request->get('direction', 'ASC');
Expand Down
1 change: 0 additions & 1 deletion api/tests/Controller/IndexControllTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ public function testAll()
$this->assertArrayHasKey('pageSize', $data);
$this->assertArrayHasKey('results', $data);
$this->assertArrayHasKey('numResults', $data);

}
}

0 comments on commit 87ab3d5

Please sign in to comment.