Skip to content

Instantly share code, notes, and snippets.

@andyczerwonka
Last active December 1, 2016 22:27
Show Gist options
  • Save andyczerwonka/6846edf8670b8f5c2c975d37d3801bf0 to your computer and use it in GitHub Desktop.
Save andyczerwonka/6846edf8670b8f5c2c975d37d3801bf0 to your computer and use it in GitHub Desktop.
class InvitationApi() extends Controller {
def invite() = Action(parse.json) { request =>
val payload = request.body.as[UserId]
val baseUrl = ApplicationConfiguration.get(this).baseUrl
sendInvitation(payload.userId, baseUrl) match {
case Success(invitation) => Ok
case Failure(e) => BadRequest(e.getMessage)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment