[PM-21405] Delete account error message (#5237)

This commit is contained in:
André Bispo
2025-05-21 16:34:42 +01:00
committed by GitHub
parent 178625222a
commit fd73360539
2 changed files with 36 additions and 0 deletions

View File

@@ -16,12 +16,16 @@ sealed class DeleteAccountResponseJson {
/**
* Models the json body of a deletion error.
*
* @param errorMessage a human readable error message.
* @param validationErrors a map where each value is a list of error messages for each key.
* The values in the array should be used for display to the user, since the keys tend to come
* back as nonsense. (eg: empty string key)
*/
@Serializable
data class Invalid(
@SerialName("message")
private val errorMessage: String?,
@SerialName("validationErrors")
private val validationErrors: Map<String, List<String?>>?,
) : DeleteAccountResponseJson() {
@@ -33,5 +37,6 @@ sealed class DeleteAccountResponseJson {
?.values
?.firstOrNull()
?.firstOrNull()
?: errorMessage
}
}