Delete items by introducing a deleted state

When deleting items via the http api, they are not deleted anymore but
a new status "Deleted" is set. The collective insights contains now a
count separately for deleted items.
This commit is contained in:
eikek
2021-08-14 14:18:03 +02:00
parent 48d13a35fc
commit cb777e30c0
10 changed files with 45 additions and 8 deletions

View File

@ -144,6 +144,8 @@ trait OItem[F[_]] {
def deleteAttachment(id: Ident, collective: Ident): F[Int]
def setDeletedState(items: NonEmptyList[Ident], collective: Ident): F[Int]
def deleteAttachmentMultiple(
attachments: NonEmptyList[Ident],
collective: Ident
@ -612,6 +614,9 @@ object OItem {
n = results.sum
} yield n
def setDeletedState(items: NonEmptyList[Ident], collective: Ident): F[Int] =
store.transact(RItem.setState(items, collective, ItemState.Deleted))
def getProposals(item: Ident, collective: Ident): F[MetaProposalList] =
store.transact(QAttachment.getMetaProposals(item, collective))