Bug 32474: Do not fetch all the licenses

Otherwise we are loosing all the point of the pagination!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2023-04-27 08:54:25 +02:00 committed by Katrin Fischer
parent 28078a6e25
commit 5b6761efdf
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 5 additions and 5 deletions

View File

@ -83,7 +83,7 @@
</li>
</ol>
</fieldset>
<a v-if="licenses.length" class="btn btn-default" @click="addLicense"
<a v-if="license_count > 0" class="btn btn-default" @click="addLicense"
><font-awesome-icon icon="plus" /> {{ $__("Add new license") }}</a
>
<span v-else>{{ $__("There are no licenses created yet") }}</span>
@ -98,7 +98,7 @@ export default {
name: "AgreementLicenses",
data() {
return {
licenses: [],
license_count: null,
}
},
props: {
@ -108,9 +108,9 @@ export default {
},
beforeCreate() {
const client = APIClient.erm
client.licenses.getAll().then(
licenses => {
this.licenses = licenses
client.licenses.count().then(
count => {
this.license_count = count
this.initialized = true
},
error => {}