Skip to content

Commit

Permalink
Merge pull request #3118 from wordpress-mobile/issue/13041-woo-search…
Browse files Browse the repository at this point in the history
…-products-add-global-unique-id-param

[Woo] [Product Global Unique Id] Search Products by Global Unique Id - Add param
  • Loading branch information
toupper authored Dec 6, 2024
2 parents 64479b5 + 2c94dd8 commit d9a3dcb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ class ProductRestClient @Inject constructor(
val payload = RemoteSearchProductsPayload(
site = site,
searchQuery = searchQuery,
globalUniqueIdSearchQuery = globalUniqueIdSearchQuery,
skuSearchOptions = skuSearchOptions,
productsWithMetaData = productModels,
offset = offset,
Expand All @@ -490,6 +491,7 @@ class ProductRestClient @Inject constructor(
site = site,
query = searchQuery,
skuSearchOptions = skuSearchOptions,
globalUniqueIdSearchQuery = globalUniqueIdSearchQuery,
filterOptions = filterOptions
)
dispatcher.dispatch(WCProductActionBuilder.newSearchedProductsAction(payload))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ class WCProductStore @Inject constructor(
var site: SiteModel,
var searchQuery: String?,
var skuSearchOptions: SkuSearchOptions,
var globalUniqueIdSearchQuery: String?,
var productsWithMetaData: List<ProductWithMetaData> = emptyList(),
var offset: Int = 0,
var loadedMore: Boolean = false,
Expand All @@ -467,10 +468,12 @@ class WCProductStore @Inject constructor(
site: SiteModel,
query: String?,
skuSearchOptions: SkuSearchOptions,
globalUniqueIdSearchQuery: String?,
filterOptions: Map<ProductFilterOption, String>?
) : this(
site = site,
searchQuery = query,
globalUniqueIdSearchQuery = globalUniqueIdSearchQuery,
skuSearchOptions = skuSearchOptions,
filterOptions = filterOptions
) {
Expand Down Expand Up @@ -700,6 +703,7 @@ class WCProductStore @Inject constructor(
class OnProductsSearched(
var searchQuery: String?,
var isSkuSearch: SkuSearchOptions,
var globalUniqueIdSearchQuery: String?,
var searchResults: List<WCProductModel> = emptyList(),
var canLoadMore: Boolean = false
) : OnChanged<ProductError>()
Expand Down Expand Up @@ -1913,7 +1917,8 @@ class WCProductStore @Inject constructor(
emitChange(
OnProductsSearched(
searchQuery = payload.searchQuery,
isSkuSearch = payload.skuSearchOptions
isSkuSearch = payload.skuSearchOptions,
globalUniqueIdSearchQuery = payload.globalUniqueIdSearchQuery
)
)
} else {
Expand All @@ -1923,6 +1928,7 @@ class WCProductStore @Inject constructor(
OnProductsSearched(
searchQuery = payload.searchQuery,
isSkuSearch = payload.skuSearchOptions,
globalUniqueIdSearchQuery = payload.globalUniqueIdSearchQuery,
searchResults = payload.productsWithMetaData.map { it.product },
canLoadMore = payload.canLoadMore
)
Expand Down

0 comments on commit d9a3dcb

Please sign in to comment.