mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-27 17:28:39 +00:00
Merge pull request #7588 from KevinSJ/feat/filter-by-http-status
Add http_status filter to /api/entries
This commit is contained in:
commit
1b8960edc4
6 changed files with 94 additions and 15 deletions
|
@ -280,6 +280,18 @@ class EntryRestController extends WallabagRestController
|
|||
* example="example.com",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Parameter(
|
||||
* name="http_status",
|
||||
* in="query",
|
||||
* description="filter entries with matching http status code",
|
||||
* required=false,
|
||||
* @OA\Schema(
|
||||
* type="integer",
|
||||
* minimum=100,
|
||||
* maximum=527,
|
||||
* example="200",
|
||||
* )
|
||||
* ),
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returned when successful"
|
||||
|
@ -306,6 +318,7 @@ class EntryRestController extends WallabagRestController
|
|||
$since = $request->query->get('since', 0);
|
||||
$detail = strtolower($request->query->get('detail', 'full'));
|
||||
$domainName = (null === $request->query->get('domain_name')) ? '' : (string) $request->query->get('domain_name');
|
||||
$httpStatus = (!\array_key_exists((int) $request->query->get('http_status'), Response::$statusTexts)) ? null : (int) $request->query->get('http_status');
|
||||
|
||||
try {
|
||||
/** @var Pagerfanta $pager */
|
||||
|
@ -320,7 +333,8 @@ class EntryRestController extends WallabagRestController
|
|||
$tags,
|
||||
$detail,
|
||||
$domainName,
|
||||
$isNotParsed
|
||||
$isNotParsed,
|
||||
$httpStatus
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
throw new BadRequestHttpException($e->getMessage());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue