voc/voctoweb

Expose "conference_title" in "recent" Public JSON API

TobiGr opened this issue · 1 comments

Currently, only the conference_url is exposed. When showing info about an event, users should see the conference name.
At the moment there are videos of 7 different conferences, this means a 7 requests need to be made. Since conference requests can be quite large, this slows down applications and also puts unnecessary load on your servers.

Would that be enough to expose conference_title?

diff --git a/app/views/public/shared/_event.json.jbuilder b/app/views/public/shared/_event.json.jbuilder
index 879dbee..d8a99ba 100644
--- a/app/views/public/shared/_event.json.jbuilder
+++ b/app/views/public/shared/_event.json.jbuilder
@@ -8,6 +8,7 @@ json.thumbnails_url event.get_thumbnails_url
 json.frontend_link frontend_event_url(slug: event.slug)
 json.url public_event_url(id: event.guid, format: :json)
 json.conference_url public_conference_url(id: event.conference.acronym, format: :json)
+json.conference_title event.conference.title
 json.related(event.related_events) do |related_event|
I did not test the changes and have no time to set the whole project up. Whoever is responsible for this repo might be able to test this within a few seconds.