Skip to content

Instantly share code, notes, and snippets.

@adamw
Created July 16, 2019 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamw/8f236faa9337199d39d06c19845db7db to your computer and use it in GitHub Desktop.
Save adamw/8f236faa9337199d39d06c19845db7db to your computer and use it in GitHub Desktop.
private val updateUserEndpoint = secureEndpoint.post
.in(User)
.in(jsonBody[UpdateUser_IN])
.out(jsonBody[UpdateUser_OUT])
.serverLogic {
case (authData, data) =>
(for {
userId <- auth(authData)
_ <- userService.changeUser(userId, data.login, data.email).transact(xa)
} yield UpdateUser_OUT()).toOut
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment