mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 18:08:25 +00:00
Update channel names when retrieving user tasks
Usertasks hold their arguments in an opaque json structure that is not connected to the other data at the db level. When loading tasks that holds references (like channels) they could have changed in the meantime. This is now a hacky way around that updates the channels when loading. Should they be deleted, the tasks fails when running.
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
|
||||
package docspell.notification.api
|
||||
|
||||
import cats.Order
|
||||
import cats.data.{NonEmptyList => Nel}
|
||||
|
||||
import io.circe.Decoder
|
||||
@ -43,4 +44,7 @@ object ChannelType {
|
||||
Decoder.decodeString.emap(fromString)
|
||||
implicit val jsonEncoder: Encoder[ChannelType] =
|
||||
Encoder.encodeString.contramap(_.name)
|
||||
|
||||
implicit val order: Order[ChannelType] =
|
||||
Order.by(_.name)
|
||||
}
|
||||
|
Reference in New Issue
Block a user