summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSean Molenaar <sean@seanmolenaar.eu>2021-05-14 22:10:29 +0200
committerSean Molenaar <SMillerDev@users.noreply.github.com>2021-05-16 16:31:16 +0200
commit2fa2fddc11cf15a594cbbc03ba1b14afa3344f01 (patch)
tree47ab198e5ebd7fbd5fd8e8413ed8cba7bb01d729 /lib
parent9f36b3af3fdd9b4a95f349277d00334c5d7b59f2 (diff)
controller: getRead + all_items is now unread type
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/ItemApiController.php7
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,