Skip to content

Commit

Permalink
PIN-4087: Fix EService in draft check
Browse files Browse the repository at this point in the history
  • Loading branch information
galales committed Oct 3, 2023
1 parent 8ad7b2b commit 85b7286
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -771,10 +771,8 @@ object ProcessApiServiceImpl {
if (eService.mode == Receive) Future.unit else Future.failed(EServiceNotInReceiveMode(eService.id))

def isDraftEService(eService: CatalogItem): Future[Unit] =
if (eService.descriptors.map(_.state) == Seq(Draft)) Future.unit
else
Future
.failed(EServiceNotInDraftState(eService.id))
if (eService.descriptors.isEmpty || eService.descriptors.map(_.state) == Seq(Draft)) Future.unit
else Future.failed(EServiceNotInDraftState(eService.id))

def assertRequesterAllowed(resourceId: UUID)(requesterId: UUID)(implicit ec: ExecutionContext): Future[Unit] =
Future.failed(GenericComponentErrors.OperationForbidden).unlessA(resourceId == requesterId)
Expand Down

0 comments on commit 85b7286

Please sign in to comment.