update postgresjson

This commit is contained in:
2019-08-27 12:33:32 +02:00
parent 67665350eb
commit ff76bd55ef
29 changed files with 139 additions and 119 deletions

View File

@@ -30,12 +30,12 @@ object FollowArticlePaths {
@KtorExperimentalLocationsAPI
fun Route.followArticle(repo: FollowArticleRepository) {
post<FollowArticlePaths.ArticleFollowRequest> {
repo.follow(FollowEntity(target = it.article, citizen = currentCitizen))
repo.follow(FollowEntity(target = it.article, createdBy = currentCitizen))
call.respond(HttpStatusCode.Created)
}
delete<FollowArticlePaths.ArticleFollowRequest> {
repo.unfollow(FollowEntity(target = it.article, citizen = currentCitizen))
repo.unfollow(FollowEntity(target = it.article, createdBy = currentCitizen))
call.respond(HttpStatusCode.NoContent)
}

View File

@@ -30,12 +30,12 @@ object FollowConstitutionPaths {
@KtorExperimentalLocationsAPI
fun Route.followConstitution(repo: FollowConstitutionRepository) {
post<FollowConstitutionPaths.ConstitutionFollowRequest> {
repo.follow(FollowEntity(target = it.constitution, citizen = currentCitizen2))
repo.follow(FollowEntity(target = it.constitution, createdBy = currentCitizen2))
call.respond(HttpStatusCode.Created)
}
delete<FollowConstitutionPaths.ConstitutionFollowRequest> {
repo.unfollow(FollowEntity(target = it.constitution, citizen = currentCitizen2))
repo.unfollow(FollowEntity(target = it.constitution, createdBy = currentCitizen2))
call.respond(HttpStatusCode.NoContent)
}