lila/modules/relation/src/main/JsonView.scala

18 lines
388 B
Scala
Raw Permalink Normal View History

package lila.relation
import play.api.libs.json._
object JsonView {
implicit def relatedWrites(implicit userWrites: Writes[lila.user.User]) =
OWrites[Related] { r =>
Json.obj(
2019-12-13 07:30:20 -07:00
"user" -> r.user,
"patron" -> r.user.isPatron,
"nbGames" -> r.nbGames,
"followable" -> r.followable,
2019-12-13 07:30:20 -07:00
"relation" -> r.relation
)
}
}