Skip to content

Commit

Permalink
Read the password from the API if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
hichamboushaba committed Sep 18, 2024
1 parent 65df272 commit e38dec4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,6 @@ data class ProductApiResponse(
val max_quantity: String? = null,
val group_of_quantity: String? = null,
val combine_variations: String? = null,
@SerializedName("post_password")
val password: String? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ class ProductDtoMapper @Inject constructor(
// Save only the subscription data, the rest of the metadata will be saved separately
metadata = metaData.filter { it.key in WCProductModel.SubscriptionMetadataKeys.ALL_KEYS }
.let { gson.toJson(it) }

password = dto.password

isSampleProduct = dto.metadata?.any {
val metaDataEntry = WCMetaData.fromJson(it.asJsonObject)
metaDataEntry?.let { json ->
Expand Down

0 comments on commit e38dec4

Please sign in to comment.