Skip to content

Commit

Permalink
Decrease Cyclomatic Complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
toupper committed Dec 4, 2024
1 parent f6b7810 commit 5762422
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,13 +654,20 @@ class ProductRestClient @Inject constructor(
}
}

if (globalUniqueIdSearchQuery.isNullOrEmpty().not()) {
params["global_unique_id"] = globalUniqueIdSearchQuery!!
}
addGlobalUniqueIdSearchQuery(params, globalUniqueIdSearchQuery)

return params
}

private fun addGlobalUniqueIdSearchQuery(
params: MutableMap<String, String>,
globalUniqueIdSearchQuery: String?
) {
if (!globalUniqueIdSearchQuery.isNullOrEmpty()) {
params["global_unique_id"] = globalUniqueIdSearchQuery
}
}

/**
* Makes a GET request to `/wp-json/wc/v3/products/categories` retrieving a list of product
* categories for the given WooCommerce [SiteModel].
Expand Down

0 comments on commit 5762422

Please sign in to comment.