Bug 32468: ERM - Populate dropdown list with all entries

The REST API routes is configured to return the 20 first results if
_per_page is not provided. Here we want to display all the
vendors/agreements/licenses/packages in the dropdown lists.

Ideally we should implement an infinite scroll to not load all the data
at once (https://vue-select.org/guide/infinite-scroll.html)

Test plan:
Create more than 20 vendors and confirm that, with this patch, all the
vendors are display in the dropdown list displayed on the add agreement
form
Same for agreements, licenses and local packages

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2022-12-15 07:58:36 +01:00 committed by Tomas Cohen Arazi
parent c06c8613cd
commit ccdc90aeea
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ export const fetchAgreement = async function (agreement_id) {
};
export const fetchAgreements = async function () {
const apiUrl = "/api/v1/erm/agreements";
const apiUrl = "/api/v1/erm/agreements?_per_page=-1";
let agreements;
await fetch(apiUrl)
.then(checkError)
@ -60,7 +60,7 @@ export const fetchLicense = async function (license_id) {
};
export const fetchLicenses = async function () {
const apiUrl = "/api/v1/erm/licenses";
const apiUrl = "/api/v1/erm/licenses?_per_page=-1";
let licenses;
await fetch(apiUrl, {
headers: {
@ -97,7 +97,7 @@ export const fetchPatron = async function (patron_id) {
};
export const fetchVendors = async function () {
const apiUrl = "/api/v1/acquisitions/vendors";
const apiUrl = "/api/v1/acquisitions/vendors?_per_page=-1";
let vendors;
await fetch(apiUrl)
.then(checkError)
@ -207,7 +207,7 @@ export const _fetchPackages = async function (apiUrl) {
return packages;
};
export const fetchLocalPackages = function () {
const apiUrl = "/api/v1/erm/eholdings/local/packages";
const apiUrl = "/api/v1/erm/eholdings/local/packages?_per_page=-1";
return _fetchPackages(apiUrl);
};
export const fetchEBSCOPackages = function () {