Guest User

Untitled

a guest
Mar 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. def update(id: Long): Action[AnyContent] = Action.async { implicit request =>
  2. topicForm.bindFromRequest.fold(
  3. formWithErrors => Future.successful(BadRequest(html.editForm(id, formWithErrors))),
  4. topic => {
  5. val futureTopUpdate = dao.update(id, topic.copy(id = Some(id)))
  6. futureTopUpdate.map { result =>
  7. Home.flashing("success" -> "Topic %s has been updated".format(topic.code))
  8. }.recover {
  9. case ex: TimeoutException =>
  10. Logger.error("Problem found in topic update process")
  11. InternalServerError(ex.getMessage)
  12. }
  13. })
  14. }
Add Comment
Please, Sign In to add comment