mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-11 01:15:26 +00:00
Merge pull request #5984 from wallabag/fix/api-tags-nb-entries
Add `nbEntries` to the API tags list response
This commit is contained in:
commit
1a49567d0c
3 changed files with 2 additions and 7 deletions
|
@ -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');
|
||||
|
||||
|
|
|
@ -33,8 +33,4 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue