Skip to content

Commit 27ddb2c

Browse files
committed
fix: respect setting for api endpoints
Signed-off-by: Roberto Vidal <roberto.vidal@ikumene.com>
1 parent 26c8aae commit 27ddb2c

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

lib/Controller/Helper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,11 @@ public function getNotesAndCategories(
7575
?string $category = null,
7676
int $chunkSize = 0,
7777
?string $chunkCursorStr = null,
78-
?bool $showHidden = null,
7978
) : array {
8079
$userId = $this->getUID();
8180
$chunkCursor = $chunkCursorStr ? ChunkCursor::fromString($chunkCursorStr) : null;
8281
$lastUpdate = $chunkCursor->timeStart ?? new \DateTime();
83-
$data = $this->notesService->getAll($userId, true, $showHidden); // auto-create notes folder if not exists
82+
$data = $this->notesService->getAll($userId, true); // auto-create notes folder if not exists
8483
$metaNotes = $this->metaService->getAll($userId, $data['notes']);
8584

8685
// if a category is requested, then ignore all other notes

lib/Controller/NotesApiController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ public function index(
6666
$this->settingsService->getAll($userId, true);
6767
// load notes and categories
6868
$exclude = explode(',', $exclude);
69-
// show hidden folders by default, ignoring settings, so clients can handle them at will
70-
$showHidden = true;
71-
$data = $this->helper->getNotesAndCategories($pruneBefore, $exclude, $category, $chunkSize, $chunkCursor, $showHidden);
69+
$data = $this->helper->getNotesAndCategories($pruneBefore, $exclude, $category, $chunkSize, $chunkCursor);
7270
$notesData = $data['notesData'];
7371
if (!$data['chunkCursor']) {
7472
// if last chunk, then send all notes (pruned)

lib/Service/NotesService.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ public function __construct(
3030
$this->noteUtil = $noteUtil;
3131
}
3232

33-
public function getAll(string $userId, bool $autoCreateNotesFolder = false, ?bool $showHidden = null) : array {
33+
public function getAll(string $userId, bool $autoCreateNotesFolder = false) : array {
3434
$customExtension = $this->getCustomExtension($userId);
3535
try {
3636
$notesFolder = $this->getNotesFolder($userId, $autoCreateNotesFolder);
37-
if ($showHidden === null) {
38-
$showHidden = $this->settings->getValueBool($userId, 'showHidden');
39-
}
37+
$showHidden = $this->settings->getValueBool($userId, 'showHidden');
4038
$data = self::gatherNoteFiles($customExtension, $notesFolder, $showHidden);
4139
$fileIds = array_keys($data['files']);
4240
// pre-load tags for all notes (performance improvement)

0 commit comments

Comments
 (0)