Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 2c6b106

Browse files
Add documentation for the new arguments
1 parent 59b3cad commit 2c6b106

File tree

1 file changed

+5
-3
lines changed
  • plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product

1 file changed

+5
-3
lines changed

plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product/ProductRestClient.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -938,20 +938,21 @@ class ProductRestClient @Inject constructor(
938938
* @param [site] The site to fetch product reviews for
939939
* @param [storedWCProductModel] the stored model to compare with the [updatedProductModel]
940940
* @param [updatedProductModel] the product model that contains the update
941+
* @param [metadataChanges] the metadata changes to be updated
941942
*/
942943
fun updateProduct(
943944
site: SiteModel,
944945
storedWCProductModel: WCProductModel?,
945946
updatedProductModel: WCProductModel,
946-
metadataRequest: UpdateMetadataRequest?
947+
metadataChanges: UpdateMetadataRequest? = null
947948
) {
948949
coroutineEngine.launch(AppLog.T.API, this, "updateProduct") {
949950
val remoteProductId = updatedProductModel.remoteProductId
950951
val url = WOOCOMMERCE.products.id(remoteProductId).pathV3
951952
val body = productModelToProductJsonBody(
952953
productModel = storedWCProductModel,
953954
updatedProductModel = updatedProductModel,
954-
metadata = metadataRequest?.toJsonArray()
955+
metadata = metadataChanges?.toJsonArray()
955956
)
956957

957958
val response = wooNetwork.executePutGsonRequest(
@@ -1718,11 +1719,12 @@ class ProductRestClient @Inject constructor(
17181719
*
17191720
* @param [site] The site to fetch product reviews for
17201721
* @param [productModel] the new product model
1722+
* @param [metaData] the metadata to be added to the product
17211723
*/
17221724
fun addProduct(
17231725
site: SiteModel,
17241726
productModel: WCProductModel,
1725-
metaData: Map<String, String>?
1727+
metaData: Map<String, String>? = null
17261728
) {
17271729
coroutineEngine.launch(AppLog.T.API, this, "addProduct") {
17281730
val url = WOOCOMMERCE.products.pathV3

0 commit comments

Comments
 (0)