From 1a6128c01bbda147c918c3c86e4ad8dfb42ab300 Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Mon, 7 Oct 2024 15:55:50 -0300 Subject: [PATCH] Fixes user metadata type not fetching all values due to pagination. --- .../admin/components/metadata-types/user/TainacanUser.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/admin/components/metadata-types/user/TainacanUser.vue b/src/views/admin/components/metadata-types/user/TainacanUser.vue index 4f04d5808..20ee49c38 100644 --- a/src/views/admin/components/metadata-types/user/TainacanUser.vue +++ b/src/views/admin/components/metadata-types/user/TainacanUser.vue @@ -107,10 +107,14 @@ export default { this.$emit('blur'); }, loadCurrentUsers() { - if ((Array.isArray(this.itemMetadatum.value) && this.itemMetadatum.value.length) || (!Array.isArray(this.itemMetadatum.value) && this.itemMetadatum.value)) { + if ( + (Array.isArray(this.itemMetadatum.value) && this.itemMetadatum.value.length) || + (!Array.isArray(this.itemMetadatum.value) && this.itemMetadatum.value) + ) { this.isLoading = true; - let query = qs.stringify({ include: this.itemMetadatum.value }); + let perPage = isNaN(this.itemMetadatum.value) ? this.itemMetadatum.value.length + 1 : 100; + let query = qs.stringify({ include: this.itemMetadatum.value, per_page: perPage }); let endpoint = '/users/'; wpApi.get(endpoint + '?' + query)