Skip to content

Commit

Permalink
#10 Fix unaudited filter on auxSrv when entity is root entity (withou…
Browse files Browse the repository at this point in the history
…t parent)
  • Loading branch information
To-om committed Feb 22, 2017
1 parent 3ad86fc commit 5c5b702
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/org/elastic4play/services/AuxSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ class AuxSrv @Inject() (
log.warn(s"Child entity (${childModel.name} ${entity.id}) has no parent !")
JsObject(Nil)
})
case _ Future.successful(Json.toJson(entity).as[JsObject])
case _ if removeUnaudited Future.successful(removeUnauditedAttributes(entity))
case _ Future.successful(Json.toJson(entity).as[JsObject])
}
if (withStats) {
for {
e entityWithParent
s entity.model.getStats(entity)
} yield e + ("stats" s)
}
else entityWithParent
} else entityWithParent
}

def apply[A](entities: Source[BaseEntity, A], nparent: Int, withStats: Boolean, removeUnaudited: Boolean): Source[JsObject, A] = {
Expand Down

0 comments on commit 5c5b702

Please sign in to comment.