Skip to content

Commit

Permalink
Get most read by location in new route
Browse files Browse the repository at this point in the history
  • Loading branch information
domlander committed Jun 3, 2024
1 parent 8b78a58 commit 2c669a0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion onward/app/controllers/MostPopularController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,16 @@ class MostPopularController(

def renderWithDeeplyRead(): Action[AnyContent] =
Action.async { implicit request =>
val edition = Edition(request)
val headers = request.headers.toSimpleMap
val countryCode = headers.getOrElse("X-GU-GeoLocation", "country:row").replace("country:", "")
val edition = countryCode match {
case "GB" => editions.Uk
case "US" => editions.Us
case "CA" => editions.Us
case "AU" => editions.Au
case "NZ" => editions.Au
case _ => Edition.defaultEdition
}

// Synchronous edition popular, from the mostPopularAgent (stateful)
val editionPopular: Option[MostPopularCollectionResponse] = {
Expand Down

0 comments on commit 2c669a0

Please sign in to comment.