mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-03-28 01:35:06 +00:00
Merge pull request #2362 from v6ak/feature/2345-setting-item-date-from-addons
Setting item date from addons (#2345)
This commit is contained in:
commit
69602527b6
@ -121,6 +121,12 @@ private[backend] class BackendCommands[F[_]: Sync](
|
||||
case ItemAction.SetName(name) =>
|
||||
logger.debug(s"Set name '$name' on item ${item.id} for $collective") *>
|
||||
itemOps.setName(item, name, collective).void
|
||||
|
||||
case ItemAction.SetDate(date) =>
|
||||
logger.debug(s"Set date $date on item ${item.id} for $collective") *>
|
||||
itemOps
|
||||
.setItemDate(Nel.of(item), date.some, collective)
|
||||
.void
|
||||
}
|
||||
|
||||
def runAttachAction(
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
package docspell.common.bc
|
||||
|
||||
import docspell.common.Ident
|
||||
import docspell.common.{Ident, Timestamp}
|
||||
|
||||
import io.circe.generic.extras.Configuration
|
||||
import io.circe.generic.extras.semiauto.{deriveConfiguredDecoder, deriveConfiguredEncoder}
|
||||
@ -99,4 +99,10 @@ object ItemAction {
|
||||
|
||||
implicit val jsonDecoder: Decoder[ItemAction] = deriveConfiguredDecoder
|
||||
implicit val jsonEncoder: Encoder[ItemAction] = deriveConfiguredEncoder
|
||||
|
||||
case class SetDate(date: Timestamp) extends ItemAction
|
||||
object SetDate {
|
||||
implicit val jsonDecoder: Decoder[SetDate] = deriveDecoder
|
||||
implicit val jsonEncoder: Encoder[SetDate] = deriveEncoder
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user