Skip to content

Commit

Permalink
Bump capi-client to 18.0.4-beta.1 - remove hack required for Lightbox
Browse files Browse the repository at this point in the history
It was introduced here: #20462

Co-authored-by: Roberto Tyley <roberto.tyley@guardian.co.uk>
  • Loading branch information
ioannakok and rtyley committed Jun 30, 2022
1 parent 555fc4c commit b3e0cd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
20 changes: 6 additions & 14 deletions applications/app/controllers/ImageContentController.scala
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 =>
Expand All @@ -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"
}
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.1"
val faciaVersion = "3.3.12"
val dispatchVersion = "0.13.1"
val romeVersion = "1.0"
Expand Down

0 comments on commit b3e0cd7

Please sign in to comment.