mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-05 23:18:47 +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()
|
$tags = $this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository('WallabagCoreBundle:Tag')
|
||||||
->findAllTags($this->getUser()->getId());
|
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
|
||||||
|
|
||||||
$json = $this->get('jms_serializer')->serialize($tags, 'json');
|
$json = $this->get('jms_serializer')->serialize($tags, 'json');
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,4 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -20,14 +20,13 @@ class TagRestControllerTest extends WallabagApiTestCase
|
||||||
$this->assertGreaterThan(0, $content);
|
$this->assertGreaterThan(0, $content);
|
||||||
$this->assertArrayHasKey('id', $content[0]);
|
$this->assertArrayHasKey('id', $content[0]);
|
||||||
$this->assertArrayHasKey('label', $content[0]);
|
$this->assertArrayHasKey('label', $content[0]);
|
||||||
|
$this->assertArrayHasKey('nbEntries', $content[0]);
|
||||||
|
|
||||||
$tagLabels = array_map(function ($i) {
|
$tagLabels = array_map(function ($i) {
|
||||||
return $i['label'];
|
return $i['label'];
|
||||||
}, $content);
|
}, $content);
|
||||||
|
|
||||||
$this->assertNotContains($this->otherUserTagLabel, $tagLabels, 'There is a possible tag leak');
|
$this->assertNotContains($this->otherUserTagLabel, $tagLabels, 'There is a possible tag leak');
|
||||||
|
|
||||||
return end($content);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testDeleteUserTag()
|
public function testDeleteUserTag()
|
||||||
|
|
Loading…
Reference in a new issue