diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2021-05-14 22:10:29 +0200 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2021-05-27 19:10:53 +0200 |
commit | 2159eccbf199703a60636d517b0645b771e8bb0a (patch) | |
tree | d7e3c4d2890c5725b5d93e389f3734678035a527 /lib | |
parent | bfc514e484f45b8ddacc2dabaad516e1db1f534c (diff) |
controller: getRead + all_items is now unread type
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/ItemApiController.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Controller/ItemApiController.php b/lib/Controller/ItemApiController.php index 5f9da73a6..2e59d5b3a 100644 --- a/lib/Controller/ItemApiController.php +++ b/lib/Controller/ItemApiController.php @@ -94,6 +94,13 @@ class ItemApiController extends ApiController ); break; default: + // Fallback in case people try getRead here + if ($getRead === false && $type === ListType::ALL_ITEMS) { + $type = ListType::UNREAD; + } elseif ($getRead === false) { + return ['message' => 'Setting getRead on an already filtered list is not allowed!']; + } + $items = $this->itemService->findAllWithFilters( $this->getUserId(), $type, |