Adds hideempty param to terms request.

This commit is contained in:
Mateus Machado Luna 2019-03-08 13:42:39 -03:00
parent 3d13ea90a9
commit 43fe53b8bb
1 changed files with 3 additions and 4 deletions

View File

@ -220,7 +220,6 @@ registerBlockType('tainacan/terms-list', {
{(
searchTaxonomyName != '' ? (
taxonomies.length > 0 ?
(
<div>
<div className="modal-taxonomies-list">
@ -240,7 +239,7 @@ registerBlockType('tainacan/terms-list', {
</div>
{ isLoadingTaxonomies ? <Spinner /> : null }
</div>
):
) :
<div className="modal-terms-loadmore-section">
<p>{ __('Sorry, no taxonomy found.', 'tainacan') }</p>
</div>
@ -508,7 +507,7 @@ registerBlockType('tainacan/terms-list', {
function fetchTerms(name) {
let endpoint = '/taxonomy/'+ taxonomyId + '/terms/?number=' + termsPerPage;
let endpoint = '/taxonomy/'+ taxonomyId + '/terms/?hideempty=0number=' + termsPerPage;
if (name != undefined && name != '')
endpoint += '&searchterm=' + name;
@ -545,7 +544,7 @@ registerBlockType('tainacan/terms-list', {
if (offset <= 0)
modalTerms = [];
let endpoint = '/taxonomy/'+ taxonomyId + '/terms/?number=' + termsPerPage + '&offset=' + offset;
let endpoint = '/taxonomy/'+ taxonomyId + '/terms/?hideempty=0&number=' + termsPerPage + '&offset=' + offset;
isLoadingTerms = true;