From 8e97136e5fd9a3ce2ff3d2256ef5316fc2c35bc9 Mon Sep 17 00:00:00 2001 From: Ioanna Kokkini Date: Thu, 9 Jun 2022 16:49:51 +0100 Subject: [PATCH] Bump capi-client to 18.0.4-beta.0 - remove hack required for Lightbox It was introduced here: https://github.com/guardian/frontend/pull/20462 Co-authored-by: Roberto Tyley --- .../controllers/ImageContentController.scala | 20 ++++++------------- project/Dependencies.scala | 2 +- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/applications/app/controllers/ImageContentController.scala b/applications/app/controllers/ImageContentController.scala index a324a08b82d6..f061c3b4a876 100644 --- a/applications/app/controllers/ImageContentController.scala +++ b/applications/app/controllers/ImageContentController.scala @@ -1,7 +1,6 @@ package controllers -import com.gu.contentapi.client.Parameter -import com.gu.contentapi.client.model.SearchQueryBase +import com.gu.contentapi.client.model.{Direction, FollowingSearchQuery, SearchQuery, SearchQueryBase} import com.gu.contentapi.client.model.v1.{ItemResponse, Content => ApiContent} import common._ import conf.switches.Switches @@ -53,11 +52,11 @@ class ImageContentController( def getNextLightboxJson(path: String, tag: String, direction: String): Action[AnyContent] = Action.async { implicit request => - val capiQuery: ContentApiNavQuery = ContentApiNavQuery(currentId = path, direction = direction) - .tag(tag) - .showTags("all") - .showElements("image") - .pageSize(contentApi.nextPreviousPageSize) + val capiQuery = FollowingSearchQuery( + SearchQuery().tag(tag).showTags("all").showElements("image").pageSize(contentApi.nextPreviousPageSize), + path, + Direction.forPathSegment(direction), + ) contentApiClient.thriftClient.getResponse(capiQuery).map { response => val lightboxJson = response.results.flatMap(result => @@ -70,10 +69,3 @@ class ImageContentController( } } } - -case class ContentApiNavQuery(parameterHolder: Map[String, Parameter] = Map.empty, currentId: String, direction: String) - extends SearchQueryBase[ContentApiNavQuery] { - def withParameters(parameterMap: Map[String, Parameter]): ContentApiNavQuery = copy(parameterMap) - - override def pathSegment: String = s"content/$currentId/$direction" -} diff --git a/project/Dependencies.scala b/project/Dependencies.scala index fc6d6b33f7b6..db2cc2850d69 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -5,7 +5,7 @@ import sbt._ object Dependencies { val identityLibVersion = "3.254" val awsVersion = "1.12.205" - val capiVersion = "18.0.1" + val capiVersion = "18.0.4-beta.0" val faciaVersion = "3.3.12" val dispatchVersion = "0.13.1" val romeVersion = "1.0"