Merge pull request #5984 from wallabag/fix/api-tags-nb-entries

Add `nbEntries` to the API tags list response
This commit is contained in:
Jérémy Benoist 2022-09-23 16:03:24 +02:00 committed by GitHub
commit 1a49567d0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 7 deletions

View file

@ -23,7 +23,7 @@ class TagRestController extends WallabagRestController
$tags = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Tag')
->findAllTags($this->getUser()->getId());
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
$json = $this->get('jms_serializer')->serialize($tags, 'json');

View file

@ -33,8 +33,4 @@
{% endfor %}
</ul>
</div>
<div>
</div>
{% endblock %}

View file

@ -20,14 +20,13 @@ class TagRestControllerTest extends WallabagApiTestCase
$this->assertGreaterThan(0, $content);
$this->assertArrayHasKey('id', $content[0]);
$this->assertArrayHasKey('label', $content[0]);
$this->assertArrayHasKey('nbEntries', $content[0]);
$tagLabels = array_map(function ($i) {
return $i['label'];
}, $content);
$this->assertNotContains($this->otherUserTagLabel, $tagLabels, 'There is a possible tag leak');
return end($content);
}
public function testDeleteUserTag()