diff options
author | ArthurHoaro <arthur@hoa.ro> | 2021-02-04 10:57:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 10:57:44 +0100 |
commit | 8997ae6c8e24286f7d47981eaf905e80d2481c10 (patch) | |
tree | 9906b122998ca4420af68b1bb110033b99f7d8bf /application/api/controllers/Tags.php | |
parent | 11edc143b42a7be09c0c9dc02730c83e8cbb73c2 (diff) | |
parent | 9b8c0a4560fa1d87cab1529099b1b4677e92e265 (diff) | |
download | Shaarli-8997ae6c8e24286f7d47981eaf905e80d2481c10.tar.gz Shaarli-8997ae6c8e24286f7d47981eaf905e80d2481c10.tar.zst Shaarli-8997ae6c8e24286f7d47981eaf905e80d2481c10.zip |
Merge pull request #1697 from ArthurHoaro/feature/pagination
Handle pagination through BookmarkService
Diffstat (limited to 'application/api/controllers/Tags.php')
-rw-r--r-- | application/api/controllers/Tags.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/application/api/controllers/Tags.php b/application/api/controllers/Tags.php index e60e00a7..5a23f6db 100644 --- a/application/api/controllers/Tags.php +++ b/application/api/controllers/Tags.php | |||
@@ -122,12 +122,12 @@ class Tags extends ApiController | |||
122 | throw new ApiBadParametersException('New tag name is required in the request body'); | 122 | throw new ApiBadParametersException('New tag name is required in the request body'); |
123 | } | 123 | } |
124 | 124 | ||
125 | $bookmarks = $this->bookmarkService->search( | 125 | $searchResult = $this->bookmarkService->search( |
126 | ['searchtags' => $args['tagName']], | 126 | ['searchtags' => $args['tagName']], |
127 | BookmarkFilter::$ALL, | 127 | BookmarkFilter::$ALL, |
128 | true | 128 | true |
129 | ); | 129 | ); |
130 | foreach ($bookmarks as $bookmark) { | 130 | foreach ($searchResult->getBookmarks() as $bookmark) { |
131 | $bookmark->renameTag($args['tagName'], $data['name']); | 131 | $bookmark->renameTag($args['tagName'], $data['name']); |
132 | $this->bookmarkService->set($bookmark, false); | 132 | $this->bookmarkService->set($bookmark, false); |
133 | $this->history->updateLink($bookmark); | 133 | $this->history->updateLink($bookmark); |
@@ -157,12 +157,12 @@ class Tags extends ApiController | |||
157 | throw new ApiTagNotFoundException(); | 157 | throw new ApiTagNotFoundException(); |
158 | } | 158 | } |
159 | 159 | ||
160 | $bookmarks = $this->bookmarkService->search( | 160 | $searchResult = $this->bookmarkService->search( |
161 | ['searchtags' => $args['tagName']], | 161 | ['searchtags' => $args['tagName']], |
162 | BookmarkFilter::$ALL, | 162 | BookmarkFilter::$ALL, |
163 | true | 163 | true |
164 | ); | 164 | ); |
165 | foreach ($bookmarks as $bookmark) { | 165 | foreach ($searchResult->getBookmarks() as $bookmark) { |
166 | $bookmark->deleteTag($args['tagName']); | 166 | $bookmark->deleteTag($args['tagName']); |
167 | $this->bookmarkService->set($bookmark, false); | 167 | $this->bookmarkService->set($bookmark, false); |
168 | $this->history->updateLink($bookmark); | 168 | $this->history->updateLink($bookmark); |