Skip to content

Commit

Permalink
Refactor conversion into expected string value
Browse files Browse the repository at this point in the history
  • Loading branch information
mvgreen committed Oct 11, 2024
1 parent 1c9d8cb commit 87d4a45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ data class FetchedStoreProfile(
app;

override fun toString(): String {
return asApiString()
}

fun asApiString(): String {
return super.toString().replace("_", "-")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class RatesCalculationTypeDeserializer : JsonDeserializer<RatesCalculationType>
context: JsonDeserializationContext
): RatesCalculationType? {
val strValue = json.asString
return RatesCalculationType.entries.firstOrNull { it.toString() == strValue }
return RatesCalculationType.entries.firstOrNull { it.asApiString() == strValue }
}
}

0 comments on commit 87d4a45

Please sign in to comment.