added basic edit account

- add link in to edit a user in users.html
- change to AccountController
  - update getCreateAccount for change to AccountForm
  - add getEditAccount
- add edit.html
- change to Mapping.kt
  - update AccountForm toAccountRequest to throw exception if password null
  - add Account Response toAccountForm
- change password and passwordConfirm to be null in AccountForm
- add PasswordException
- add getAccount to AccountRegistryService
- add accountRegistryAccount to WebClientCalls.kt
This commit is contained in:
2025-01-27 13:26:31 +01:00
parent 8e65de0350
commit 14e7971f73
8 changed files with 167 additions and 4 deletions

View File

@@ -1,10 +1,12 @@
package ltd.hlaeja.service
import io.github.oshai.kotlinlogging.KotlinLogging
import java.util.UUID
import ltd.hlaeja.exception.AccountRegistryException
import ltd.hlaeja.library.accountRegistry.Account
import ltd.hlaeja.library.accountRegistry.Authentication
import ltd.hlaeja.property.AccountRegistryProperty
import ltd.hlaeja.util.accountRegistryAccount
import ltd.hlaeja.util.accountRegistryAccounts
import ltd.hlaeja.util.accountRegistryAuthenticate
import ltd.hlaeja.util.accountRegistryCreate
@@ -66,4 +68,14 @@ class AccountRegistryService(
else -> Mono.error(ResponseStatusException(BAD_REQUEST, error.message))
}
}
fun getAccount(
account: UUID,
): Mono<Account.Response> = webClient.accountRegistryAccount(account, property)
.onErrorResume { error ->
when (error) {
is ResponseStatusException -> Mono.error(error)
else -> Mono.error(ResponseStatusException(BAD_REQUEST, error.message))
}
}
}