Allow to only return owning spaces

This commit is contained in:
Eike Kettner
2020-07-09 23:23:02 +02:00
parent 6c304b4e7a
commit ea4ab11195
5 changed files with 25 additions and 6 deletions

View File

@ -9,7 +9,11 @@ import docspell.store.queries.QSpace
trait OSpace[F[_]] {
def findAll(collective: Ident, nameQuery: Option[String]): F[Vector[OSpace.SpaceItem]]
def findAll(
collective: Ident,
ownerLogin: Option[Ident],
nameQuery: Option[String]
): F[Vector[OSpace.SpaceItem]]
def findById(id: Ident, collective: Ident): F[Option[OSpace.SpaceDetail]]
@ -55,9 +59,10 @@ object OSpace {
Resource.pure[F, OSpace[F]](new OSpace[F] {
def findAll(
collective: Ident,
ownerLogin: Option[Ident],
nameQuery: Option[String]
): F[Vector[SpaceItem]] =
store.transact(QSpace.findAll(collective, None, nameQuery))
store.transact(QSpace.findAll(collective, None, ownerLogin, nameQuery))
def findById(id: Ident, collective: Ident): F[Option[SpaceDetail]] =
store.transact(QSpace.findById(id, collective))