From 2fa2fddc11cf15a594cbbc03ba1b14afa3344f01 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Fri, 14 May 2021 22:10:29 +0200 Subject: controller: getRead + all_items is now unread type Signed-off-by: Sean Molenaar --- lib/Controller/ItemApiController.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') 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, -- cgit v1.2.3