mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Fail early when source id is wrong
This commit is contained in:
@ -8,7 +8,7 @@ import docspell.backend.PasswordCrypt
|
||||
import docspell.backend.ops.OCollective._
|
||||
import docspell.common._
|
||||
import docspell.store.queries.QCollective
|
||||
import docspell.store.records.{RCollective, RContact, RUser}
|
||||
import docspell.store.records._
|
||||
import docspell.store.{AddResult, Store}
|
||||
|
||||
trait OCollective[F[_]] {
|
||||
@ -41,6 +41,8 @@ trait OCollective[F[_]] {
|
||||
kind: Option[ContactKind]
|
||||
): Stream[F, RContact]
|
||||
|
||||
def findSource(sourceId: Ident): F[Option[RSource]]
|
||||
|
||||
}
|
||||
|
||||
object OCollective {
|
||||
@ -156,5 +158,7 @@ object OCollective {
|
||||
): Stream[F, RContact] =
|
||||
store.transact(QCollective.getContacts(collective, query, kind))
|
||||
|
||||
def findSource(sourceId: Ident): F[Option[RSource]] =
|
||||
store.transact(RSource.find(sourceId))
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user