update create and edit account role mapping
This commit is contained in:
@@ -16,17 +16,13 @@ fun AccountForm.toAccountRequest(): Account.Request = Account.Request(
|
|||||||
username = username,
|
username = username,
|
||||||
password = if (password.isNullOrEmpty()) null else password,
|
password = if (password.isNullOrEmpty()) null else password,
|
||||||
enabled = enabled,
|
enabled = enabled,
|
||||||
roles = roles.map { "ROLE_${it.uppercase()}" },
|
roles = roles.map { it.uppercase() },
|
||||||
)
|
)
|
||||||
|
|
||||||
fun Account.Response.toAccountForm(): AccountForm = AccountForm(
|
fun Account.Response.toAccountForm(): AccountForm = AccountForm(
|
||||||
username = username,
|
username = username,
|
||||||
enabled = enabled,
|
enabled = enabled,
|
||||||
roles = roles.map {
|
roles = roles.map { it.lowercase().replaceFirstChar { char -> char.uppercase() } },
|
||||||
it.removePrefix("ROLE_")
|
|
||||||
.lowercase()
|
|
||||||
.replaceFirstChar { char -> char.uppercase() }
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
fun TypeForm.toTypeRequest(): Type.Request = Type.Request(
|
fun TypeForm.toTypeRequest(): Type.Request = Type.Request(
|
||||||
|
|||||||
Reference in New Issue
Block a user