in common-lib/src/main/scala/com/gu/workflow/util/StubDecorator.scala [56:65]
private def getDecoratedPrintLocation(bookId: Long, bookSectionId: Long): Future[Option[DecoratedPrintLocation]] = {
for {
maybeBook <- contentAPI.getTagInternalName(bookId)
maybeBookSection <- contentAPI.getTagInternalName(bookSectionId)
} yield (maybeBook, maybeBookSection) match {
case (Some(book), Some(bookSection)) => Some(DecoratedPrintLocation(bookSection, Some(s"$book >> $bookSection")))
case (_, Some(bookSection)) => Some(DecoratedPrintLocation(bookSection, None))
case _ => None
}
}