2016-02-22 20:54:37 -07:00
|
|
|
package lila.relation
|
|
|
|
|
2016-03-05 20:50:34 -07:00
|
|
|
import play.api.libs.json._
|
2016-02-22 20:54:37 -07:00
|
|
|
|
|
|
|
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,
|
2016-02-22 20:54:37 -07:00
|
|
|
"followable" -> r.followable,
|
2019-12-13 07:30:20 -07:00
|
|
|
"relation" -> r.relation
|
2016-07-05 14:40:07 -06:00
|
|
|
)
|
2016-02-22 20:54:37 -07:00
|
|
|
}
|
|
|
|
}
|