Set the folder of an item

This commit is contained in:
Eike Kettner
2020-07-11 12:00:19 +02:00
parent 5bde78083a
commit 86443e10a6
8 changed files with 155 additions and 6 deletions

View File

@ -24,6 +24,8 @@ trait OItem[F[_]] {
def setDirection(item: Ident, direction: Direction, collective: Ident): F[AddResult]
def setFolder(item: Ident, folder: Option[Ident], collective: Ident): F[AddResult]
def setCorrOrg(item: Ident, org: Option[Ident], collective: Ident): F[AddResult]
def addCorrOrg(item: Ident, org: OOrganization.OrgAndContacts): F[AddResult]
@ -131,6 +133,16 @@ object OItem {
.attempt
.map(AddResult.fromUpdate)
def setFolder(
item: Ident,
folder: Option[Ident],
collective: Ident
): F[AddResult] =
store
.transact(RItem.updateFolder(item, collective, folder))
.attempt
.map(AddResult.fromUpdate)
def setCorrOrg(item: Ident, org: Option[Ident], collective: Ident): F[AddResult] =
store
.transact(RItem.updateCorrOrg(item, collective, org))