From 8afa17f940fe5da02a73cfdef4def337c339e7b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonne=20Ha=C3=9F?= Date: Sat, 27 Apr 2019 16:03:02 +0200 Subject: [PATCH] Don't return aspect order in single user info API route --- app/presenters/aspect_presenter.rb | 9 ++++----- app/presenters/person_presenter.rb | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/presenters/aspect_presenter.rb b/app/presenters/aspect_presenter.rb index 726ec505a..facf4d398 100644 --- a/app/presenters/aspect_presenter.rb +++ b/app/presenters/aspect_presenter.rb @@ -11,13 +11,12 @@ class AspectPresenter < BasePresenter } end - def as_api_json(full=false) + def as_api_json(full=false, with_order: true) values = { - id: @aspect.id, - name: @aspect.name, - order: @aspect.order_id + id: @aspect.id, + name: @aspect.name } - + values[:order] = @aspect.order_id if with_order values[:chat_enabled] = @aspect.chat_enabled if full values end diff --git a/app/presenters/person_presenter.rb b/app/presenters/person_presenter.rb index 70f260362..ee0d495f5 100644 --- a/app/presenters/person_presenter.rb +++ b/app/presenters/person_presenter.rb @@ -103,7 +103,7 @@ class PersonPresenter < BasePresenter return [] unless current_user_person_contact aspects_for_person = current_user.aspects_with_person(@presentable) - aspects_for_person.map {|a| AspectPresenter.new(a).as_api_json(false) } + aspects_for_person.map {|a| AspectPresenter.new(a).as_api_json(false, with_order: false) } end def person_is_following_current_user