From d3e08987892010f780e0d1a538989f0810a00ef0 Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Tue, 12 Nov 2019 12:12:14 -0300 Subject: [PATCH] Fixes Gutenberg selection blocks wich weren't selecting more than ten items. --- .../carousel-collections-list-theme.vue | 2 +- .../tainacan-collections/carousel-collections-list/index.js | 2 +- .../carousel-items-list/carousel-items-list-theme.vue | 2 +- .../tainacan-items/carousel-items-list/index.js | 2 +- src/gutenberg-blocks/tainacan-items/items-list/items-modal.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list-theme.vue b/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list-theme.vue index e87700aec..6a4531f40 100644 --- a/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list-theme.vue +++ b/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/carousel-collections-list-theme.vue @@ -250,7 +250,7 @@ export default { this.collectionsRequestSource = axios.CancelToken.source(); - let endpoint = '/collections?'+ qs.stringify({ postin: this.selectedCollections }) + '&fetch_only=name,url,thumbnail'; + let endpoint = '/collections?'+ qs.stringify({ postin: this.selectedCollections, perpage: this.selectedCollections.length }) + '&fetch_only=name,url,thumbnail'; this.tainacanAxios.get(endpoint, { cancelToken: this.collectionsRequestSource.token }) .then(response => { diff --git a/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/index.js b/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/index.js index 84efe953c..728107ac5 100644 --- a/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/index.js +++ b/src/gutenberg-blocks/tainacan-collections/carousel-collections-list/index.js @@ -215,7 +215,7 @@ registerBlockType('tainacan/carousel-collections-list', { collections = []; - let endpoint = '/collections?'+ qs.stringify({ postin: selectedCollections }) + '&fetch_only=name,url,thumbnail'; + let endpoint = '/collections?'+ qs.stringify({ postin: selectedCollections, perpage: selectedCollections.length }) + '&fetch_only=name,url,thumbnail'; tainacan.get(endpoint, { cancelToken: itemsRequestSource.token }) .then(response => { diff --git a/src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.vue b/src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.vue index 4035c8efb..02913f3a2 100644 --- a/src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.vue +++ b/src/gutenberg-blocks/tainacan-items/carousel-items-list/carousel-items-list-theme.vue @@ -261,7 +261,7 @@ export default { this.itemsRequestSource = axios.CancelToken.source(); if (this.loadStrategy == 'selection') { - let endpoint = '/collection/' + this.collectionId + '/items?' + qs.stringify({ postin: this.selectedItems }) + '&fetch_only=title,url,thumbnail'; + let endpoint = '/collection/' + this.collectionId + '/items?' + qs.stringify({ postin: this.selectedItems, perpage: this.selectedItems.length }) + '&fetch_only=title,url,thumbnail'; this.tainacanAxios.get(endpoint, { cancelToken: this.itemsRequestSource.token }) .then(response => { diff --git a/src/gutenberg-blocks/tainacan-items/carousel-items-list/index.js b/src/gutenberg-blocks/tainacan-items/carousel-items-list/index.js index 30ddffc7f..151a3f400 100644 --- a/src/gutenberg-blocks/tainacan-items/carousel-items-list/index.js +++ b/src/gutenberg-blocks/tainacan-items/carousel-items-list/index.js @@ -200,7 +200,7 @@ registerBlockType('tainacan/carousel-items-list', { items = []; if (loadStrategy == 'selection') { - let endpoint = '/collection/' + collectionId + '/items?'+ qs.stringify({ postin: selectedItems }) + '&fetch_only=title,url,thumbnail'; + let endpoint = '/collection/' + collectionId + '/items?'+ qs.stringify({ postin: selectedItems, perpage: selectedItems.length }) + '&fetch_only=title,url,thumbnail'; tainacan.get(endpoint, { cancelToken: itemsRequestSource.token }) .then(response => { diff --git a/src/gutenberg-blocks/tainacan-items/items-list/items-modal.js b/src/gutenberg-blocks/tainacan-items/items-list/items-modal.js index b36c050bb..38e7d71e7 100644 --- a/src/gutenberg-blocks/tainacan-items/items-list/items-modal.js +++ b/src/gutenberg-blocks/tainacan-items/items-list/items-modal.js @@ -85,7 +85,7 @@ export default class ItemsModal extends React.Component { let anItemsRequestSource = axios.CancelToken.source(); - let endpoint = '/collection/' + this.state.collectionId + '/items?'+ qs.stringify({ postin: selectedItems }) + '&fetch_only=title,url,thumbnail'; + let endpoint = '/collection/' + this.state.collectionId + '/items?'+ qs.stringify({ postin: selectedItems, perpage: selectedItems.length }) + '&fetch_only=title,url,thumbnail'; tainacan.get(endpoint, { cancelToken: anItemsRequestSource.token }) .then(response => {