Implement pagination to tags and categories query

[MAILPOET-1613]
This commit is contained in:
Pavel Dohnal
2018-11-13 10:12:48 +01:00
parent 19d13c5165
commit 141cb09a54
4 changed files with 25 additions and 9 deletions

View File

@ -210,7 +210,8 @@ define([
ajax: {
data: function (params) {
return {
term: params.term
term: params.term,
page: params.page || 1
};
},
transport: function (options, success, failure) {
@ -223,6 +224,7 @@ define([
// Fetch available terms based on the list of taxonomies already fetched
termsPromise = CommunicationComponent.getTerms({
search: options.data.term,
page: options.data.page,
taxonomies: _.keys(taxonomies)
}).then(function (terms) {
return {
@ -248,7 +250,10 @@ define([
id: item.term_id
}, item);
}
)
),
pagination: {
more: data.terms.length === 100
}
};
}
}

View File

@ -205,7 +205,8 @@ define([
ajax: {
data: function (params) {
return {
term: params.term
term: params.term,
page: params.page || 1
};
},
transport: function (options, success, failure) {
@ -218,6 +219,7 @@ define([
// Fetch available terms based on the list of taxonomies already fetched
termsPromise = CommunicationComponent.getTerms({
search: options.data.term,
page: options.data.page,
taxonomies: _.keys(taxonomies)
}).then(function (terms) {
return {
@ -243,7 +245,10 @@ define([
id: item.term_id
}, item);
}
)
),
pagination: {
more: data.terms.length === 100
}
};
}
}

View File

@ -372,7 +372,8 @@ define([
ajax: {
data: function (params) {
return {
term: params.term
term: params.term,
page: params.page || 1
};
},
transport: function (options, success, failure) {
@ -385,6 +386,7 @@ define([
// Fetch available terms based on the list of taxonomies already fetched
termsPromise = CommunicationComponent.getTerms({
search: options.data.term,
page: options.data.page,
taxonomies: _.keys(taxonomies)
}).then(function (terms) {
return {
@ -410,7 +412,10 @@ define([
id: item.term_id
}, item);
}
)
),
pagination: {
more: data.terms.length === 100
}
};
}
}