Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def update(id: Long): Action[AnyContent] = Action.async { implicit request =>
- topicForm.bindFromRequest.fold(
- formWithErrors => Future.successful(BadRequest(html.editForm(id, formWithErrors))),
- topic => {
- val futureTopUpdate = dao.update(id, topic.copy(id = Some(id)))
- futureTopUpdate.map { result =>
- Home.flashing("success" -> "Topic %s has been updated".format(topic.code))
- }.recover {
- case ex: TimeoutException =>
- Logger.error("Problem found in topic update process")
- InternalServerError(ex.getMessage)
- }
- })
- }
Add Comment
Please, Sign In to add comment