mirror of
https://github.com/anyproto/anytype-kotlin.git
synced 2025-06-08 05:47:05 +09:00
DROID-3409 Primitives | Reset layout conflict (#2217)
This commit is contained in:
parent
7bec1556cb
commit
eb0f7e16a9
25 changed files with 405 additions and 99 deletions
|
@ -232,7 +232,7 @@ interface BlockRepository {
|
|||
suspend fun cancelObjectSearchSubscription(subscriptions: List<Id>)
|
||||
|
||||
suspend fun addRelationToObject(ctx: Id, relation: Key): Payload?
|
||||
suspend fun deleteRelationFromObject(ctx: Id, relation: Key): Payload
|
||||
suspend fun deleteRelationFromObject(ctx: Id, relations: List<Key>): Payload
|
||||
|
||||
suspend fun debugSpace(space: SpaceId): String
|
||||
|
||||
|
|
|
@ -3,29 +3,31 @@ package com.anytypeio.anytype.domain.relations
|
|||
import com.anytypeio.anytype.core_models.Id
|
||||
import com.anytypeio.anytype.core_models.Key
|
||||
import com.anytypeio.anytype.core_models.Payload
|
||||
import com.anytypeio.anytype.domain.base.BaseUseCase
|
||||
import com.anytypeio.anytype.domain.base.AppCoroutineDispatchers
|
||||
import com.anytypeio.anytype.domain.base.ResultInteractor
|
||||
import com.anytypeio.anytype.domain.block.repo.BlockRepository
|
||||
|
||||
/**
|
||||
* Use-case for deleting a relation from an object.
|
||||
*/
|
||||
class DeleteRelationFromObject(
|
||||
private val repo: BlockRepository
|
||||
) : BaseUseCase<Payload, DeleteRelationFromObject.Params>() {
|
||||
private val repo: BlockRepository,
|
||||
dispatchers: AppCoroutineDispatchers
|
||||
) : ResultInteractor<DeleteRelationFromObject.Params, Payload>(dispatchers.io) {
|
||||
|
||||
override suspend fun run(params: Params) = safe {
|
||||
repo.deleteRelationFromObject(
|
||||
override suspend fun doWork(params: Params): Payload {
|
||||
return repo.deleteRelationFromObject(
|
||||
ctx = params.ctx,
|
||||
relation = params.relation
|
||||
relations = params.relations
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ctx id of the object
|
||||
* @param relation relation key
|
||||
* @param relations relation keys
|
||||
*/
|
||||
class Params(
|
||||
val ctx: Id,
|
||||
val relation: Key
|
||||
val relations: List<Key>
|
||||
)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue