mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 11:01:04 +00:00
Add nbEntries
to the API tags list response
So client will be able to do the same as in the web UI. Also remove empty `div` from the tags template.
This commit is contained in:
parent
a452bb6204
commit
812b4a906f
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