Skip to content

Commit c5b1f41

Browse files
committed
Set new SKU search parameter when useLegacyEndpoint is true.
1 parent 76b02db commit c5b1f41

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Networking/Networking/Remote/ProductsRemote.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,9 @@ public final class ProductsRemote: Remote, ProductsRemoteProtocol {
250250
pageNumber: Int,
251251
pageSize: Int,
252252
completion: @escaping (Result<[Product], Error>) -> Void) {
253+
let skuParameterKey = useLegacyEndpoint ? ParameterKey.sku: ParameterKey.partialSKUSearch
253254
let parameters = [
254-
ParameterKey.sku: keyword,
255+
skuParameterKey: keyword,
255256
ParameterKey.page: String(pageNumber),
256257
ParameterKey.perPage: String(pageSize)
257258
]
@@ -352,6 +353,7 @@ public extension ProductsRemote {
352353
static let orderBy: String = "orderby"
353354
static let order: String = "order"
354355
static let sku: String = "sku"
356+
static let partialSKUSearch: String = "search_sku"
355357
static let productStatus: String = "status"
356358
static let productType: String = "type"
357359
static let stockStatus: String = "stock_status"

0 commit comments

Comments
 (0)