Skip to content

Commit

Permalink
#2263 Fix dataType existence test
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Nov 26, 2021
1 parent b9b2972 commit 1a0c20f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ObservableTypeSrv @Inject() (@Named("integrity-check-actor") integrityChec
createEntity(observableType)

def remove(idOrName: EntityIdOrName)(implicit graph: Graph): Try[Unit] =
if (isUsed(idOrName)) Success(get(idOrName).remove())
if (!isUsed(idOrName)) Success(get(idOrName).remove())
else Failure(BadRequestError(s"Observable type $idOrName is used"))

def isUsed(idOrName: EntityIdOrName)(implicit graph: Graph): Boolean = get(idOrName).inE[ObservableObservableType].exists
Expand Down

0 comments on commit 1a0c20f

Please sign in to comment.