{"action":"created","comment":{"url":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/comments/67847412","id":67847412,"diff_hunk":"@@ -0,0 +1,57 @@\n+const { createAction } = require('redux-actions')\n+const { get_body } = require('app/http')\n+const { merge, compose, objOf, map, props, zipWith, pick } = require('ramda')\n+const formatDate = require('app/format_date')\n+\n+const SEND_NEWSLETTER_POST =\n+  'SEND_NEWSLETTER_POST'\n+const SEND_SUB_REMINDER_POST =\n+  'SEND_SUB_REMINDER_POST'\n+\n+const initialState = {\n+  post_members: [],\n+  sub_reminders: []\n+}\n+\n+const reducer = (state = initialState, { type, payload }) => {\n+  switch (type) {\n+  case SEND_NEWSLETTER_POST:\n+    return { ...state, post_members: payload.results }\n+  case SEND_SUB_REMINDER_POST:\n+    const idObj = map(pick([ 'id' ]), payload.results)\n+    const addressArray = map(addressArr, payload.results)\n+    const contentArray = map(objOf('email_content'), map(inject, payload.results))\n+    const letterObj = zipWith(merge, contentArray, addressArray)","path":"src/admin/redux/modules/letters.js","position":null,"original_position":24,"commit_id":"d5ac5ae78e9381ae35b5003fa850896bfed8d6c1","original_commit_id":"f845636926105bae8e8cb1983ba0ea6ecf5300cd","user":{"login":"rjmk","id":12041390,"avatar_url":"https://avatars.githubusercontent.com/u/12041390?v=3","gravatar_id":"","url":"https://api.github.com/users/rjmk","html_url":"https://github.com/rjmk","followers_url":"https://api.github.com/users/rjmk/followers","following_url":"https://api.github.com/users/rjmk/following{/other_user}","gists_url":"https://api.github.com/users/rjmk/gists{/gist_id}","starred_url":"https://api.github.com/users/rjmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjmk/subscriptions","organizations_url":"https://api.github.com/users/rjmk/orgs","repos_url":"https://api.github.com/users/rjmk/repos","events_url":"https://api.github.com/users/rjmk/events{/privacy}","received_events_url":"https://api.github.com/users/rjmk/received_events","type":"User","site_admin":false},"body":"Yes you're right on the needing an `[{}]` instead of a `{}` and that you would need as many as the length of the array. The trick will be pulling the map out of the individual `idObj`, `addresses`, etc and out over the reduce","created_at":"2016-06-21T10:55:53Z","updated_at":"2016-06-21T10:55:53Z","html_url":"https://github.com/foundersandcoders/sail-back/pull/264#discussion_r67847412","pull_request_url":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/264","_links":{"self":{"href":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/comments/67847412"},"html":{"href":"https://github.com/foundersandcoders/sail-back/pull/264#discussion_r67847412"},"pull_request":{"href":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/264"}}},"pull_request":{"url":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/264","id":74444000,"html_url":"https://github.com/foundersandcoders/sail-back/pull/264","diff_url":"https://github.com/foundersandcoders/sail-back/pull/264.diff","patch_url":"https://github.com/foundersandcoders/sail-back/pull/264.patch","issue_url":"https://api.github.com/repos/foundersandcoders/sail-back/issues/264","number":264,"state":"open","locked":false,"title":"New letter endpoint","user":{"login":"JMurphyWeb","id":12638261,"avatar_url":"https://avatars.githubusercontent.com/u/12638261?v=3","gravatar_id":"","url":"https://api.github.com/users/JMurphyWeb","html_url":"https://github.com/JMurphyWeb","followers_url":"https://api.github.com/users/JMurphyWeb/followers","following_url":"https://api.github.com/users/JMurphyWeb/following{/other_user}","gists_url":"https://api.github.com/users/JMurphyWeb/gists{/gist_id}","starred_url":"https://api.github.com/users/JMurphyWeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JMurphyWeb/subscriptions","organizations_url":"https://api.github.com/users/JMurphyWeb/orgs","repos_url":"https://api.github.com/users/JMurphyWeb/repos","events_url":"https://api.github.com/users/JMurphyWeb/events{/privacy}","received_events_url":"https://api.github.com/users/JMurphyWeb/received_events","type":"User","site_admin":false},"body":"Currently the Letters reducer is returning the array for both actions, which is causing an error on clicking 'Get Members'. Also it seems like a bad pattern so we will now work on returning an object with two different arrays, one holding all post members and the other storing the letter objects.\r\n\r\n","created_at":"2016-06-20T13:35:09Z","updated_at":"2016-06-21T10:55:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8882af471532a5e70fd4c093260175656a2267ef","assignee":{"login":"rjmk","id":12041390,"avatar_url":"https://avatars.githubusercontent.com/u/12041390?v=3","gravatar_id":"","url":"https://api.github.com/users/rjmk","html_url":"https://github.com/rjmk","followers_url":"https://api.github.com/users/rjmk/followers","following_url":"https://api.github.com/users/rjmk/following{/other_user}","gists_url":"https://api.github.com/users/rjmk/gists{/gist_id}","starred_url":"https://api.github.com/users/rjmk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjmk/subscriptions","organizations_url":"https://api.github.com/users/rjmk/orgs","repos_url":"https://api.github.com/users/rjmk/repos","events_url":"https://api.github.com/users/rjmk/events{/privacy}","received_events_url":"https://api.github.com/users/rjmk/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/264/commits","review_comments_url":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/264/comments","review_comment_url":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/comments{/number}","comments_url":"https://api.github.com/repos/foundersandcoders/sail-back/issues/264/comments","statuses_url":"https://api.github.com/repos/foundersandcoders/sail-back/statuses/d5ac5ae78e9381ae35b5003fa850896bfed8d6c1","head":{"label":"foundersandcoders:new-letter-endpoint","ref":"new-letter-endpoint","sha":"d5ac5ae78e9381ae35b5003fa850896bfed8d6c1","user":{"login":"foundersandcoders","id":9970257,"avatar_url":"https://avatars.githubusercontent.com/u/9970257?v=3","gravatar_id":"","url":"https://api.github.com/users/foundersandcoders","html_url":"https://github.com/foundersandcoders","followers_url":"https://api.github.com/users/foundersandcoders/followers","following_url":"https://api.github.com/users/foundersandcoders/following{/other_user}","gists_url":"https://api.github.com/users/foundersandcoders/gists{/gist_id}","starred_url":"https://api.github.com/users/foundersandcoders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foundersandcoders/subscriptions","organizations_url":"https://api.github.com/users/foundersandcoders/orgs","repos_url":"https://api.github.com/users/foundersandcoders/repos","events_url":"https://api.github.com/users/foundersandcoders/events{/privacy}","received_events_url":"https://api.github.com/users/foundersandcoders/received_events","type":"Organization","site_admin":false},"repo":{"id":36240693,"name":"sail-back","full_name":"foundersandcoders/sail-back","owner":{"login":"foundersandcoders","id":9970257,"avatar_url":"https://avatars.githubusercontent.com/u/9970257?v=3","gravatar_id":"","url":"https://api.github.com/users/foundersandcoders","html_url":"https://github.com/foundersandcoders","followers_url":"https://api.github.com/users/foundersandcoders/followers","following_url":"https://api.github.com/users/foundersandcoders/following{/other_user}","gists_url":"https://api.github.com/users/foundersandcoders/gists{/gist_id}","starred_url":"https://api.github.com/users/foundersandcoders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foundersandcoders/subscriptions","organizations_url":"https://api.github.com/users/foundersandcoders/orgs","repos_url":"https://api.github.com/users/foundersandcoders/repos","events_url":"https://api.github.com/users/foundersandcoders/events{/privacy}","received_events_url":"https://api.github.com/users/foundersandcoders/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/foundersandcoders/sail-back","description":"Membership management for Friends of Chichester Harbour","fork":false,"url":"https://api.github.com/repos/foundersandcoders/sail-back","forks_url":"https://api.github.com/repos/foundersandcoders/sail-back/forks","keys_url":"https://api.github.com/repos/foundersandcoders/sail-back/keys{/key_id}","collaborators_url":"https://api.github.com/repos/foundersandcoders/sail-back/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/foundersandcoders/sail-back/teams","hooks_url":"https://api.github.com/repos/foundersandcoders/sail-back/hooks","issue_events_url":"https://api.github.com/repos/foundersandcoders/sail-back/issues/events{/number}","events_url":"https://api.github.com/repos/foundersandcoders/sail-back/events","assignees_url":"https://api.github.com/repos/foundersandcoders/sail-back/assignees{/user}","branches_url":"https://api.github.com/repos/foundersandcoders/sail-back/branches{/branch}","tags_url":"https://api.github.com/repos/foundersandcoders/sail-back/tags","blobs_url":"https://api.github.com/repos/foundersandcoders/sail-back/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/foundersandcoders/sail-back/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/foundersandcoders/sail-back/git/refs{/sha}","trees_url":"https://api.github.com/repos/foundersandcoders/sail-back/git/trees{/sha}","statuses_url":"https://api.github.com/repos/foundersandcoders/sail-back/statuses/{sha}","languages_url":"https://api.github.com/repos/foundersandcoders/sail-back/languages","stargazers_url":"https://api.github.com/repos/foundersandcoders/sail-back/stargazers","contributors_url":"https://api.github.com/repos/foundersandcoders/sail-back/contributors","subscribers_url":"https://api.github.com/repos/foundersandcoders/sail-back/subscribers","subscription_url":"https://api.github.com/repos/foundersandcoders/sail-back/subscription","commits_url":"https://api.github.com/repos/foundersandcoders/sail-back/commits{/sha}","git_commits_url":"https://api.github.com/repos/foundersandcoders/sail-back/git/commits{/sha}","comments_url":"https://api.github.com/repos/foundersandcoders/sail-back/comments{/number}","issue_comment_url":"https://api.github.com/repos/foundersandcoders/sail-back/issues/comments{/number}","contents_url":"https://api.github.com/repos/foundersandcoders/sail-back/contents/{+path}","compare_url":"https://api.github.com/repos/foundersandcoders/sail-back/compare/{base}...{head}","merges_url":"https://api.github.com/repos/foundersandcoders/sail-back/merges","archive_url":"https://api.github.com/repos/foundersandcoders/sail-back/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/foundersandcoders/sail-back/downloads","issues_url":"https://api.github.com/repos/foundersandcoders/sail-back/issues{/number}","pulls_url":"https://api.github.com/repos/foundersandcoders/sail-back/pulls{/number}","milestones_url":"https://api.github.com/repos/foundersandcoders/sail-back/milestones{/number}","notifications_url":"https://api.github.com/repos/foundersandcoders/sail-back/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/foundersandcoders/sail-back/labels{/name}","releases_url":"https://api.github.com/repos/foundersandcoders/sail-back/releases{/id}","deployments_url":"https://api.github.com/repos/foundersandcoders/sail-back/deployments","created_at":"2015-05-25T16:05:54Z","updated_at":"2016-02-04T16:27:13Z","pushed_at":"2016-06-21T10:54:18Z","git_url":"git://github.com/foundersandcoders/sail-back.git","ssh_url":"git@github.com:foundersandcoders/sail-back.git","clone_url":"https://github.com/foundersandcoders/sail-back.git","svn_url":"https://github.com/foundersandcoders/sail-back","homepage":"","size":2824,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":4,"default_branch":"master"}},"base":{"label":"foundersandcoders:master","ref":"master","sha":"d81afd0f1a5aca6658fe97c3914d91961e5facf6","user":{"login":"foundersandcoders","id":9970257,"avatar_url":"https://avatars.githubusercontent.com/u/9970257?v=3","gravatar_id":"","url":"https://api.github.com/users/foundersandcoders","html_url":"https://github.com/foundersandcoders","followers_url":"https://api.github.com/users/foundersandcoders/followers","following_url":"https://api.github.com/users/foundersandcoders/following{/other_user}","gists_url":"https://api.github.com/users/foundersandcoders/gists{/gist_id}","starred_url":"https://api.github.com/users/foundersandcoders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foundersandcoders/subscriptions","organizations_url":"https://api.github.com/users/foundersandcoders/orgs","repos_url":"https://api.github.com/users/foundersandcoders/repos","events_url":"https://api.github.com/users/foundersandcoders/events{/privacy}","received_events_url":"https://api.github.com/users/foundersandcoders/received_events","type":"Organization","site_admin":false},"repo":{"id":36240693,"name":"sail-back","full_name":"foundersandcoders/sail-back","owner":{"login":"foundersandcoders","id":9970257,"avatar_url":"https://avatars.githubusercontent.com/u/9970257?v=3","gravatar_id":"","url":"https://api.github.com/users/foundersandcoders","html_url":"https://github.com/foundersandcoders","followers_url":"https://api.github.com/users/foundersandcoders/followers","following_url":"https://api.github.com/users/foundersandcoders/following{/other_user}","gists_url":"https://api.github.com/users/foundersandcoders/gists{/gist_id}","starred_url":"https://api.github.com/users/foundersandcoders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foundersandcoders/subscriptions","organizations_url":"https://api.github.com/users/foundersandcoders/orgs","repos_url":"https://api.github.com/users/foundersandcoders/repos","events_url":"https://api.github.com/users/foundersandcoders/events{/privacy}","received_events_url":"https://api.github.com/users/foundersandcoders/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/foundersandcoders/sail-back","description":"Membership management for Friends of Chichester Harbour","fork":false,"url":"https://api.github.com/repos/foundersandcoders/sail-back","forks_url":"https://api.github.com/repos/foundersandcoders/sail-back/forks","keys_url":"https://api.github.com/repos/foundersandcoders/sail-back/keys{/key_id}","collaborators_url":"https://api.github.com/repos/foundersandcoders/sail-back/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/foundersandcoders/sail-back/teams","hooks_url":"https://api.github.com/repos/foundersandcoders/sail-back/hooks","issue_events_url":"https://api.github.com/repos/foundersandcoders/sail-back/issues/events{/number}","events_url":"https://api.github.com/repos/foundersandcoders/sail-back/events","assignees_url":"https://api.github.com/repos/foundersandcoders/sail-back/assignees{/user}","branches_url":"https://api.github.com/repos/foundersandcoders/sail-back/branches{/branch}","tags_url":"https://api.github.com/repos/foundersandcoders/sail-back/tags","blobs_url":"https://api.github.com/repos/foundersandcoders/sail-back/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/foundersandcoders/sail-back/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/foundersandcoders/sail-back/git/refs{/sha}","trees_url":"https://api.github.com/repos/foundersandcoders/sail-back/git/trees{/sha}","statuses_url":"https://api.github.com/repos/foundersandcoders/sail-back/statuses/{sha}","languages_url":"https://api.github.com/repos/foundersandcoders/sail-back/languages","stargazers_url":"https://api.github.com/repos/foundersandcoders/sail-back/stargazers","contributors_url":"https://api.github.com/repos/foundersandcoders/sail-back/contributors","subscribers_url":"https://api.github.com/repos/foundersandcoders/sail-back/subscribers","subscription_url":"https://api.github.com/repos/foundersandcoders/sail-back/subscription","commits_url":"https://api.github.com/repos/foundersandcoders/sail-back/commits{/sha}","git_commits_url":"https://api.github.com/repos/foundersandcoders/sail-back/git/commits{/sha}","comments_url":"https://api.github.com/repos/foundersandcoders/sail-back/comments{/number}","issue_comment_url":"https://api.github.com/repos/foundersandcoders/sail-back/issues/comments{/number}","contents_url":"https://api.github.com/repos/foundersandcoders/sail-back/contents/{+path}","compare_url":"https://api.github.com/repos/foundersandcoders/sail-back/compare/{base}...{head}","merges_url":"https://api.github.com/repos/foundersandcoders/sail-back/merges","archive_url":"https://api.github.com/repos/foundersandcoders/sail-back/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/foundersandcoders/sail-back/downloads","issues_url":"https://api.github.com/repos/foundersandcoders/sail-back/issues{/number}","pulls_url":"https://api.github.com/repos/foundersandcoders/sail-back/pulls{/number}","milestones_url":"https://api.github.com/repos/foundersandcoders/sail-back/milestones{/number}","notifications_url":"https://api.github.com/repos/foundersandcoders/sail-back/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/foundersandcoders/sail-back/labels{/name}","releases_url":"https://api.github.com/repos/foundersandcoders/sail-back/releases{/id}","deployments_url":"https://api.github.com/repos/foundersandcoders/sail-back/deployments","created_at":"2015-05-25T16:05:54Z","updated_at":"2016-02-04T16:27:13Z","pushed_at":"2016-06-21T10:54:18Z","git_url":"git://github.com/foundersandcoders/sail-back.git","ssh_url":"git@github.com:foundersandcoders/sail-back.git","clone_url":"https://github.com/foundersandcoders/sail-back.git","svn_url":"https://github.com/foundersandcoders/sail-back","homepage":"","size":2824,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/264"},"html":{"href":"https://github.com/foundersandcoders/sail-back/pull/264"},"issue":{"href":"https://api.github.com/repos/foundersandcoders/sail-back/issues/264"},"comments":{"href":"https://api.github.com/repos/foundersandcoders/sail-back/issues/264/comments"},"review_comments":{"href":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/264/comments"},"review_comment":{"href":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/foundersandcoders/sail-back/pulls/264/commits"},"statuses":{"href":"https://api.github.com/repos/foundersandcoders/sail-back/statuses/d5ac5ae78e9381ae35b5003fa850896bfed8d6c1"}}}}
{"actor":{"display_login":"rjmk"}}