Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getProductList = SecuredAction {
- database withSession {
- implicit session =>
- val productList = TableQuery[Products].sortBy(_.name).list()
- val pl = productList.map( p => Map("id" -> Json.toJson(p._1),"name" -> Json.toJson(p._2)))
- //play.api.Logger.debug(Json.stringify(Json.toJson(pl)))
- Ok(Json.toJson(pl))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement