Skip to content

Commit

Permalink
Include contributorInformation in Hypermedia API, so that we can pull…
Browse files Browse the repository at this point in the history
… contributor images easily in flexible-content, for use in the multi-byline element
  • Loading branch information
rhystmills committed Sep 6, 2024
1 parent e2462c4 commit c688511
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/model/TagEntity.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ case class TagEntity(
path: String,
subType: Option[String],
adBlockingLevel: Option[BlockingLevel],
contributionBlockingLevel: Option[BlockingLevel]
contributionBlockingLevel: Option[BlockingLevel],
contributorInformation: Option[ContributorInformation] = None,
)

object TagEntity {
Expand Down Expand Up @@ -54,7 +55,8 @@ object TagEntity {
tag.path,
subtype,
tag.adBlockingLevel,
tag.contributionBlockingLevel
tag.contributionBlockingLevel,
tag.contributorInformation
)
}

Expand All @@ -81,7 +83,8 @@ object TagEntity {
"section" -> Json.toJson(te.section),
"parents" -> JsArray(te.parents.map(Json.toJson(_)).toSeq),
"externalReferences" -> JsArray(te.references.map(Json.toJson(_))),
"path" -> JsString(te.path)
"path" -> JsString(te.path),
"byline" -> Json.toJson(te.contributorInformation)
) ++ te.subType.map("subType" -> JsString(_))
++ te.adBlockingLevel.map(level => "adBlockingLevel" -> JsString(level.entryName))
++ te.contributionBlockingLevel.map(level => "contributionBlockingLevel" -> JsString(level.entryName))
Expand Down

0 comments on commit c688511

Please sign in to comment.