Move sent mails when merging items

Fixes: 1055
This commit is contained in:
eikek
2021-09-08 22:29:34 +02:00
parent 84e16f65f9
commit 506e9a0c36
2 changed files with 13 additions and 4 deletions

View File

@ -71,4 +71,7 @@ object RSentMailItem {
def deleteAllByItem(item: Ident): ConnectionIO[Int] =
DML.delete(T, T.itemId === item)
def moveToItem(target: Ident, others: NonEmptyList[Ident]): ConnectionIO[Int] =
DML.update(T, T.itemId.in(others), DML.set(T.itemId.setTo(target)))
}