Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def read(title: String) = Action {
- def tryGetTodo(title: String): Option[TodoData] =
- if(todos.isEmpty) None
- else todos.find(_.title == title)
- tryGetTodo(title).fold(NotFound) { todo =>
- Json.toJson(todo)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement