feature #14: create route for unfollow article

This commit is contained in:
2019-08-14 22:49:01 +02:00
parent 17746d9b1e
commit 9821833dd8
3 changed files with 28 additions and 5 deletions

View File

@@ -21,5 +21,16 @@ open class Follow <T: EntityI<UUID>>(override var requester: Requester): Reposit
"citizen_id" to follow.citizen.id
)
}
fun unfollow(follow: FollowEntity<T>) {
val reference = follow.target::class.simpleName!!.toLowerCase()
requester
.getFunction("unfollow")
.sendQuery(
"reference" to reference,
"target_id" to follow.target.id,
"citizen_id" to follow.citizen.id
)
}
}
class FollowArticleRepository(override var requester: Requester): Follow<ArticleEntity>(requester)