mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 10:28:27 +00:00
Adopt modules to new collective table
This commit is contained in:
@ -70,7 +70,7 @@ object BasicData {
|
||||
|
||||
def find(
|
||||
itemIds: NonEmptyList[Ident],
|
||||
account: AccountId,
|
||||
account: AccountInfo,
|
||||
now: Timestamp
|
||||
): ConnectionIO[Vector[Item]] = {
|
||||
import ItemQueryDsl._
|
||||
|
@ -46,7 +46,7 @@ object DeleteFieldValueCtx {
|
||||
for {
|
||||
now <- OptionT.liftF(Timestamp.current[ConnectionIO])
|
||||
items <- OptionT.liftF(Item.find(ev.items, ev.account, now))
|
||||
field <- OptionT(RCustomField.findById(ev.field, ev.account.collective))
|
||||
field <- OptionT(RCustomField.findById(ev.field, ev.account.collectiveId))
|
||||
msg = DeleteFieldValueCtx(
|
||||
ev,
|
||||
Data(
|
||||
@ -71,7 +71,7 @@ object DeleteFieldValueCtx {
|
||||
)
|
||||
|
||||
final case class Data(
|
||||
account: AccountId,
|
||||
account: AccountInfo,
|
||||
items: List[Item],
|
||||
field: Field,
|
||||
itemUrl: Option[String]
|
||||
|
@ -61,7 +61,7 @@ object ItemSelectionCtx {
|
||||
items.toList,
|
||||
ev.itemUrl,
|
||||
ev.more,
|
||||
ev.account.user.id
|
||||
ev.account.login.id
|
||||
)
|
||||
)
|
||||
} yield msg
|
||||
@ -73,12 +73,12 @@ object ItemSelectionCtx {
|
||||
items <- ev.items.traverse(Item.sample[F])
|
||||
} yield ItemSelectionCtx(
|
||||
ev,
|
||||
Data(ev.account, items.toList, ev.itemUrl, ev.more, ev.account.user.id)
|
||||
Data(ev.account, items.toList, ev.itemUrl, ev.more, ev.account.login.id)
|
||||
)
|
||||
)
|
||||
|
||||
final case class Data(
|
||||
account: AccountId,
|
||||
account: AccountInfo,
|
||||
items: List[Item],
|
||||
itemUrl: Option[String],
|
||||
more: Boolean,
|
||||
@ -89,7 +89,7 @@ object ItemSelectionCtx {
|
||||
io.circe.generic.semiauto.deriveEncoder
|
||||
|
||||
def create(
|
||||
account: AccountId,
|
||||
account: AccountInfo,
|
||||
items: Vector[ListItem],
|
||||
baseUrl: Option[LenientUri],
|
||||
more: Boolean,
|
||||
@ -100,7 +100,7 @@ object ItemSelectionCtx {
|
||||
items.map(Item(now)).toList,
|
||||
baseUrl.map(_.asString),
|
||||
more,
|
||||
account.user.id
|
||||
account.login.id
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ object SetFieldValueCtx {
|
||||
for {
|
||||
now <- OptionT.liftF(Timestamp.current[ConnectionIO])
|
||||
items <- OptionT.liftF(Item.find(ev.items, ev.account, now))
|
||||
field <- OptionT(RCustomField.findById(ev.field, ev.account.collective))
|
||||
field <- OptionT(RCustomField.findById(ev.field, ev.account.collectiveId))
|
||||
msg = SetFieldValueCtx(
|
||||
ev,
|
||||
Data(
|
||||
@ -70,7 +70,7 @@ object SetFieldValueCtx {
|
||||
)
|
||||
|
||||
final case class Data(
|
||||
account: AccountId,
|
||||
account: AccountInfo,
|
||||
items: List[Item],
|
||||
field: Field,
|
||||
value: String,
|
||||
|
@ -39,8 +39,8 @@ object TagsChangedCtx {
|
||||
def apply: Factory =
|
||||
EventContext.factory(ev =>
|
||||
for {
|
||||
tagsAdded <- RTag.findAllByNameOrId(ev.added, ev.account.collective)
|
||||
tagsRemov <- RTag.findAllByNameOrId(ev.removed, ev.account.collective)
|
||||
tagsAdded <- RTag.findAllByNameOrId(ev.added, ev.account.collectiveId)
|
||||
tagsRemov <- RTag.findAllByNameOrId(ev.removed, ev.account.collectiveId)
|
||||
now <- Timestamp.current[ConnectionIO]
|
||||
items <- Item.find(ev.items, ev.account, now)
|
||||
msg = TagsChangedCtx(
|
||||
@ -69,7 +69,7 @@ object TagsChangedCtx {
|
||||
)
|
||||
|
||||
final case class Data(
|
||||
account: AccountId,
|
||||
account: AccountInfo,
|
||||
items: List[Item],
|
||||
added: List[Tag],
|
||||
removed: List[Tag],
|
||||
|
Reference in New Issue
Block a user