Skip to content

Commit

Permalink
Merge branch '1.0.x' into PIN-4487
Browse files Browse the repository at this point in the history
  • Loading branch information
beetlecrunch authored Feb 6, 2024
2 parents 823a136 + 0712ec8 commit 1410898
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,10 @@ final case class ProcessApiServiceImpl(
): Future[CatalogItem] = {
if (Seq(ADMIN_ROLE, API_ROLE).contains(role) && catalogItem.producerId == organizationId)
Future.successful(catalogItem)
else {
catalogItem match {
case CatalogItem(_, _, _, _, _, _, descriptors, _, _, _) if descriptors.forall(_.state == Draft) =>
Future.failed(EServiceNotFound(catalogItem.id.toString))
case CatalogItem(_, _, _, _, _, _, descriptors, _, _, _) =>
Future.successful(catalogItem.copy(descriptors = descriptors.filterNot(_.state == Draft)))
}
}
else if (catalogItem.descriptors.forall(_.state == Draft))
Future.failed(EServiceNotFound(catalogItem.id.toString))
else
Future.successful(catalogItem.copy(descriptors = catalogItem.descriptors.filterNot(_.state == Draft)))
}

override def getEServiceById(eServiceId: String)(implicit
Expand Down

0 comments on commit 1410898

Please sign in to comment.