From 1f0cd7c9ce31ac436cd49784451f542356447543 Mon Sep 17 00:00:00 2001 From: William Chong Date: Tue, 4 Feb 2025 18:47:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Get=20100=20items=20for=20listin?= =?UTF-8?q?g=20tags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/store/index.vue | 6 +++++- src/store/modules/nft.js | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/pages/store/index.vue b/src/pages/store/index.vue index 7264a8f6c..2e3143484 100644 --- a/src/pages/store/index.vue +++ b/src/pages/store/index.vue @@ -576,7 +576,11 @@ export default { ...getCMSTagIdsForRecommendedBookstoreItemsByLocale(i18n.locale).map( tagId => store - .dispatch('lazyFetchBookstoreCMSProductsByTagId', { tagId, t }) + .dispatch('lazyFetchBookstoreCMSProductsByTagId', { + tagId, + t, + limit: 100, + }) .catch(() => ({ records: [] })) ), ]; diff --git a/src/store/modules/nft.js b/src/store/modules/nft.js index 105a265c8..70e46ce35 100644 --- a/src/store/modules/nft.js +++ b/src/store/modules/nft.js @@ -1082,7 +1082,7 @@ const actions = { }, async fetchBookstoreCMSProductsByTagId( { commit, getters }, - { tagId, t, offset } + { tagId, t, limit, offset } ) { if ( !tagId || @@ -1100,7 +1100,7 @@ const actions = { commit(fetchingMutation, { id: tagId, value: true }); const { data } = await this.$api.get( - api.fetchBookstoreCMSProductsByTagId(tagId, { t, offset }) + api.fetchBookstoreCMSProductsByTagId(tagId, { t, offset, limit }) ); commit(TYPES.NFT_SET_BOOKSTORE_CMS_PRODUCTS_BY_TAG_ID, { @@ -1118,22 +1118,29 @@ const actions = { commit(fetchingMutation, { id: tagId, value: false }); } }, - async fetchMoreBookstoreCMSProductsByTagId({ dispatch, getters }, { tagId }) { + async fetchMoreBookstoreCMSProductsByTagId( + { dispatch, getters }, + { tagId, limit } + ) { const offset = getters.nftGetBookstoreCMSProductsPaginationOffsetByTagId( tagId ); if (!offset) return; - await dispatch('fetchBookstoreCMSProductsByTagId', { tagId, offset }); + await dispatch('fetchBookstoreCMSProductsByTagId', { + tagId, + offset, + limit, + }); }, async lazyFetchBookstoreCMSProductsByTagId( { dispatch, getters }, - { tagId, t } + { tagId, t, limit } ) { if (!tagId || getters.nftGetBookstoreCMSProductsByTagIdHasFetched(tagId)) { return; } - await dispatch('fetchBookstoreCMSProductsByTagId', { tagId, t }); + await dispatch('fetchBookstoreCMSProductsByTagId', { tagId, t, limit }); }, };