Skip to content

Commit

Permalink
rename maxItemId to newestItemId to match docs
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
  • Loading branch information
Grotax committed Mar 18, 2022
1 parent 4096408 commit c94dde2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is mostly based on [Keep a Changelog](https://keepachangelog.com/en/1
### Changed

### Fixed
- Fix no item marked as read by Folder API due to mismatch in parameter name (#1703)

# Releases
## [18.0.1-beta1] - 2022-03-09
Expand Down
6 changes: 3 additions & 3 deletions lib/Controller/FolderApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ public function update(?int $folderId, string $name)
* @CORS
*
* @param int|null $folderId ID of the folder
* @param int $maxItemId The newest read item
* @param int $newestItemId The newest read item
*/
public function read(?int $folderId, int $maxItemId): void
public function read(?int $folderId, int $newestItemId): void
{
$folderId = $folderId === 0 ? null : $folderId;

$this->folderService->read($this->getUserId(), $folderId, $maxItemId);
$this->folderService->read($this->getUserId(), $folderId, $newestItemId);
}
}
4 changes: 2 additions & 2 deletions lib/Db/FolderMapperV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public function read(string $userId, int $id, ?int $maxItemID = null): int
->setParameter('folderId', $id);

if ($maxItemID !== null) {
$idBuilder->andWhere('items.id <= :maxItemId')
->setParameter('maxItemId', $maxItemID);
$idBuilder->andWhere('items.id <= :maxItemID')
->setParameter('maxItemID', $maxItemID);
}

$idList = array_map(function ($value): int {
Expand Down
6 changes: 3 additions & 3 deletions lib/Service/FolderServiceV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,17 @@ public function open(string $userId, ?int $folderId, bool $open): Entity
*
* @param string $userId Folder owner
* @param int $id Folder ID
* @param int|null $maxItemID Highest item ID to mark as read
* @param int|null $newestItemId Highest item ID to mark as read
*
* @return int
*
* @throws ServiceConflictException
* @throws ServiceNotFoundException
*/
public function read(string $userId, int $id, ?int $maxItemID = null): int
public function read(string $userId, int $id, ?int $newestItemId = null): int
{
$folder = $this->find($userId, $id);

return $this->mapper->read($userId, $folder->getId(), $maxItemID);
return $this->mapper->read($userId, $folder->getId(), $newestItemId);
}
}

0 comments on commit c94dde2

Please sign in to comment.