{"action":"created","issue":{"url":"https://api.github.com/repos/DoSomething/phoenix/issues/6649","repository_url":"https://api.github.com/repos/DoSomething/phoenix","labels_url":"https://api.github.com/repos/DoSomething/phoenix/issues/6649/labels{/name}","comments_url":"https://api.github.com/repos/DoSomething/phoenix/issues/6649/comments","events_url":"https://api.github.com/repos/DoSomething/phoenix/issues/6649/events","html_url":"https://github.com/DoSomething/phoenix/pull/6649","id":163009557,"number":6649,"title":"Update to response data structure for kudos in RB items.","user":{"login":"weerd","id":105849,"avatar_url":"https://avatars.githubusercontent.com/u/105849?v=3","gravatar_id":"","url":"https://api.github.com/users/weerd","html_url":"https://github.com/weerd","followers_url":"https://api.github.com/users/weerd/followers","following_url":"https://api.github.com/users/weerd/following{/other_user}","gists_url":"https://api.github.com/users/weerd/gists{/gist_id}","starred_url":"https://api.github.com/users/weerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weerd/subscriptions","organizations_url":"https://api.github.com/users/weerd/orgs","repos_url":"https://api.github.com/users/weerd/repos","events_url":"https://api.github.com/users/weerd/events{/privacy}","received_events_url":"https://api.github.com/users/weerd/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-06-29T19:41:41Z","updated_at":"2016-06-30T18:00:29Z","closed_at":"2016-06-30T17:29:54Z","pull_request":{"url":"https://api.github.com/repos/DoSomething/phoenix/pulls/6649","html_url":"https://github.com/DoSomething/phoenix/pull/6649","diff_url":"https://github.com/DoSomething/phoenix/pull/6649.diff","patch_url":"https://github.com/DoSomething/phoenix/pull/6649.patch"},"body":"#### What's this PR do?\r\nThis PR uses some of the work completed in #6642 to update the response when Kudos reaction data is included in the `/reportback-items` response. It makes the response much more useful (and waaaay more compact) for how we actually use the Kudos data (particularly in the campaign galleries), and also takes into account the current user and indicates in the response data whether they reacted on each Reportback Item, removing a lot of the logic we currently have to do on the client-side.\r\n\r\nExample of the new response:\r\n![image](https://cloud.githubusercontent.com/assets/105849/16466033/a542afba-3e0f-11e6-8bc7-480f0271415c.png)\r\n\r\n#### How should this be reviewed?\r\nHit the `/reporback-items` endpoint and make sure the nested kudos objects in the data for each RB item looks correct.\r\n\r\n#### Any background context you want to provide?\r\nSince the response data for the reportback items is changing I will be double-checking to make sure nothing gets broken where we use Kudos now.\r\n\r\n_NOTE:_ I think there maybe be a better approach in general for how the above is accomplished, but by modifying the query for when RB items are retrieved. Instead of getting all the Kudos IDs for each RB item, gathering totals for each item on the fly. Not sure if this is more efficient or not... someone with better SQL chops would know better 😣\r\n\r\n#### Relevant tickets\r\nFixes #6594 \r\n\r\n---\r\n"},"comment":{"url":"https://api.github.com/repos/DoSomething/phoenix/issues/comments/229739428","html_url":"https://github.com/DoSomething/phoenix/pull/6649#issuecomment-229739428","issue_url":"https://api.github.com/repos/DoSomething/phoenix/issues/6649","id":229739428,"user":{"login":"weerd","id":105849,"avatar_url":"https://avatars.githubusercontent.com/u/105849?v=3","gravatar_id":"","url":"https://api.github.com/users/weerd","html_url":"https://github.com/weerd","followers_url":"https://api.github.com/users/weerd/followers","following_url":"https://api.github.com/users/weerd/following{/other_user}","gists_url":"https://api.github.com/users/weerd/gists{/gist_id}","starred_url":"https://api.github.com/users/weerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weerd/subscriptions","organizations_url":"https://api.github.com/users/weerd/orgs","repos_url":"https://api.github.com/users/weerd/repos","events_url":"https://api.github.com/users/weerd/events{/privacy}","received_events_url":"https://api.github.com/users/weerd/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T18:00:29Z","updated_at":"2016-06-30T18:00:29Z","body":"#### Checklist\r\n- [ ] Documentation added for new features/changed endpoints. 😬 \r\n"}}
{"actor":{"display_login":"weerd"}}