{"action":"created","comment":{"url":"https://api.github.com/repos/code-squad/java-qna/pulls/comments/191316110","pull_request_review_id":123861836,"id":191316110,"diff_hunk":"@@ -23,42 +23,43 @@ public String join() {\n \n     @PostMapping(\"/create\")\n     public String create(User user){\n-        System.out.println(\"user: \" + user);\n-        users.add(user);\n+        userRepository.save(user);\n         return \"redirect:/users/list\";\n     }\n \n     @GetMapping(\"/list\")\n     public String list(Model model) {\n-        model.addAttribute(\"users\", users);\n+        model.addAttribute(\"users\", userRepository.findAll());\n         return \"list\";\n     }\n \n     @GetMapping(\"/{userId}\")\n     public String profile(@PathVariable String userId ,Model model){\n-        for (User user:users) {\n+        for (User user:userRepository.findAll()) {\n             if (user.getUserId().equals(userId)){\n-                model.addAttribute(\"user\", user);\n+                model.addAttribute(\"user\", userRepository.findAll());\n             }\n         }\n         return \"profile\";\n     }\n \n     @GetMapping(\"/{userId}/form\")\n     public String update(@PathVariable String userId, Model model) {\n-        for (User user:users) {\n+        for (User user:userRepository.findAll()) {","path":"src/main/java/codesquad/web/UserController.java","position":60,"original_position":60,"commit_id":"a1f5476c8afb3175e9002d9a513b364d9220f78f","original_commit_id":"a1f5476c8afb3175e9002d9a513b364d9220f78f","user":{"login":"javajigi","id":520500,"avatar_url":"https://avatars2.githubusercontent.com/u/520500?v=4","gravatar_id":"","url":"https://api.github.com/users/javajigi","html_url":"https://github.com/javajigi","followers_url":"https://api.github.com/users/javajigi/followers","following_url":"https://api.github.com/users/javajigi/following{/other_user}","gists_url":"https://api.github.com/users/javajigi/gists{/gist_id}","starred_url":"https://api.github.com/users/javajigi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javajigi/subscriptions","organizations_url":"https://api.github.com/users/javajigi/orgs","repos_url":"https://api.github.com/users/javajigi/repos","events_url":"https://api.github.com/users/javajigi/events{/privacy}","received_events_url":"https://api.github.com/users/javajigi/received_events","type":"User","site_admin":false},"body":"db에서 모든 데이터를 조회하지 않고 id에 해당하는 데이터를 조회해 업데이트하도록 수정한다.\r\nuserRepository.findById() 활용한다.","created_at":"2018-05-29T06:36:45Z","updated_at":"2018-05-29T06:37:41Z","html_url":"https://github.com/code-squad/java-qna/pull/46#discussion_r191316110","pull_request_url":"https://api.github.com/repos/code-squad/java-qna/pulls/46","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/code-squad/java-qna/pulls/comments/191316110"},"html":{"href":"https://github.com/code-squad/java-qna/pull/46#discussion_r191316110"},"pull_request":{"href":"https://api.github.com/repos/code-squad/java-qna/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/code-squad/java-qna/pulls/46","id":191043023,"html_url":"https://github.com/code-squad/java-qna/pull/46","diff_url":"https://github.com/code-squad/java-qna/pull/46.diff","patch_url":"https://github.com/code-squad/java-qna/pull/46.patch","issue_url":"https://api.github.com/repos/code-squad/java-qna/issues/46","number":46,"state":"open","locked":false,"title":"DB연동 & PUT메소드 사용","user":{"login":"JosephChun","id":10148495,"avatar_url":"https://avatars3.githubusercontent.com/u/10148495?v=4","gravatar_id":"","url":"https://api.github.com/users/JosephChun","html_url":"https://github.com/JosephChun","followers_url":"https://api.github.com/users/JosephChun/followers","following_url":"https://api.github.com/users/JosephChun/following{/other_user}","gists_url":"https://api.github.com/users/JosephChun/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephChun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephChun/subscriptions","organizations_url":"https://api.github.com/users/JosephChun/orgs","repos_url":"https://api.github.com/users/JosephChun/repos","events_url":"https://api.github.com/users/JosephChun/events{/privacy}","received_events_url":"https://api.github.com/users/JosephChun/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-29T06:22:29Z","updated_at":"2018-05-29T06:37:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ebc325520111fef35acd6ab52b267ede0fc6440","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/code-squad/java-qna/pulls/46/commits","review_comments_url":"https://api.github.com/repos/code-squad/java-qna/pulls/46/comments","review_comment_url":"https://api.github.com/repos/code-squad/java-qna/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-squad/java-qna/issues/46/comments","statuses_url":"https://api.github.com/repos/code-squad/java-qna/statuses/a1f5476c8afb3175e9002d9a513b364d9220f78f","head":{"label":"JosephChun:step3","ref":"step3","sha":"a1f5476c8afb3175e9002d9a513b364d9220f78f","user":{"login":"JosephChun","id":10148495,"avatar_url":"https://avatars3.githubusercontent.com/u/10148495?v=4","gravatar_id":"","url":"https://api.github.com/users/JosephChun","html_url":"https://github.com/JosephChun","followers_url":"https://api.github.com/users/JosephChun/followers","following_url":"https://api.github.com/users/JosephChun/following{/other_user}","gists_url":"https://api.github.com/users/JosephChun/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephChun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephChun/subscriptions","organizations_url":"https://api.github.com/users/JosephChun/orgs","repos_url":"https://api.github.com/users/JosephChun/repos","events_url":"https://api.github.com/users/JosephChun/events{/privacy}","received_events_url":"https://api.github.com/users/JosephChun/received_events","type":"User","site_admin":false},"repo":{"id":133307561,"name":"java-qna","full_name":"JosephChun/java-qna","owner":{"login":"JosephChun","id":10148495,"avatar_url":"https://avatars3.githubusercontent.com/u/10148495?v=4","gravatar_id":"","url":"https://api.github.com/users/JosephChun","html_url":"https://github.com/JosephChun","followers_url":"https://api.github.com/users/JosephChun/followers","following_url":"https://api.github.com/users/JosephChun/following{/other_user}","gists_url":"https://api.github.com/users/JosephChun/gists{/gist_id}","starred_url":"https://api.github.com/users/JosephChun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JosephChun/subscriptions","organizations_url":"https://api.github.com/users/JosephChun/orgs","repos_url":"https://api.github.com/users/JosephChun/repos","events_url":"https://api.github.com/users/JosephChun/events{/privacy}","received_events_url":"https://api.github.com/users/JosephChun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JosephChun/java-qna","description":"질문 답변 게시판 미션을 위한 저장소","fork":true,"url":"https://api.github.com/repos/JosephChun/java-qna","forks_url":"https://api.github.com/repos/JosephChun/java-qna/forks","keys_url":"https://api.github.com/repos/JosephChun/java-qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JosephChun/java-qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JosephChun/java-qna/teams","hooks_url":"https://api.github.com/repos/JosephChun/java-qna/hooks","issue_events_url":"https://api.github.com/repos/JosephChun/java-qna/issues/events{/number}","events_url":"https://api.github.com/repos/JosephChun/java-qna/events","assignees_url":"https://api.github.com/repos/JosephChun/java-qna/assignees{/user}","branches_url":"https://api.github.com/repos/JosephChun/java-qna/branches{/branch}","tags_url":"https://api.github.com/repos/JosephChun/java-qna/tags","blobs_url":"https://api.github.com/repos/JosephChun/java-qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JosephChun/java-qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JosephChun/java-qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/JosephChun/java-qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JosephChun/java-qna/statuses/{sha}","languages_url":"https://api.github.com/repos/JosephChun/java-qna/languages","stargazers_url":"https://api.github.com/repos/JosephChun/java-qna/stargazers","contributors_url":"https://api.github.com/repos/JosephChun/java-qna/contributors","subscribers_url":"https://api.github.com/repos/JosephChun/java-qna/subscribers","subscription_url":"https://api.github.com/repos/JosephChun/java-qna/subscription","commits_url":"https://api.github.com/repos/JosephChun/java-qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/JosephChun/java-qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/JosephChun/java-qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/JosephChun/java-qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/JosephChun/java-qna/contents/{+path}","compare_url":"https://api.github.com/repos/JosephChun/java-qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JosephChun/java-qna/merges","archive_url":"https://api.github.com/repos/JosephChun/java-qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JosephChun/java-qna/downloads","issues_url":"https://api.github.com/repos/JosephChun/java-qna/issues{/number}","pulls_url":"https://api.github.com/repos/JosephChun/java-qna/pulls{/number}","milestones_url":"https://api.github.com/repos/JosephChun/java-qna/milestones{/number}","notifications_url":"https://api.github.com/repos/JosephChun/java-qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JosephChun/java-qna/labels{/name}","releases_url":"https://api.github.com/repos/JosephChun/java-qna/releases{/id}","deployments_url":"https://api.github.com/repos/JosephChun/java-qna/deployments","created_at":"2018-05-14T05:07:48Z","updated_at":"2018-05-14T05:07:50Z","pushed_at":"2018-05-29T06:22:08Z","git_url":"git://github.com/JosephChun/java-qna.git","ssh_url":"git@github.com:JosephChun/java-qna.git","clone_url":"https://github.com/JosephChun/java-qna.git","svn_url":"https://github.com/JosephChun/java-qna","homepage":null,"size":353,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"code-squad:JosephChun","ref":"JosephChun","sha":"dd0bcfffe431dc17483a78b96c0f5774a8c01796","user":{"login":"code-squad","id":22832280,"avatar_url":"https://avatars2.githubusercontent.com/u/22832280?v=4","gravatar_id":"","url":"https://api.github.com/users/code-squad","html_url":"https://github.com/code-squad","followers_url":"https://api.github.com/users/code-squad/followers","following_url":"https://api.github.com/users/code-squad/following{/other_user}","gists_url":"https://api.github.com/users/code-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/code-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-squad/subscriptions","organizations_url":"https://api.github.com/users/code-squad/orgs","repos_url":"https://api.github.com/users/code-squad/repos","events_url":"https://api.github.com/users/code-squad/events{/privacy}","received_events_url":"https://api.github.com/users/code-squad/received_events","type":"Organization","site_admin":false},"repo":{"id":125971521,"name":"java-qna","full_name":"code-squad/java-qna","owner":{"login":"code-squad","id":22832280,"avatar_url":"https://avatars2.githubusercontent.com/u/22832280?v=4","gravatar_id":"","url":"https://api.github.com/users/code-squad","html_url":"https://github.com/code-squad","followers_url":"https://api.github.com/users/code-squad/followers","following_url":"https://api.github.com/users/code-squad/following{/other_user}","gists_url":"https://api.github.com/users/code-squad/gists{/gist_id}","starred_url":"https://api.github.com/users/code-squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-squad/subscriptions","organizations_url":"https://api.github.com/users/code-squad/orgs","repos_url":"https://api.github.com/users/code-squad/repos","events_url":"https://api.github.com/users/code-squad/events{/privacy}","received_events_url":"https://api.github.com/users/code-squad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-squad/java-qna","description":"질문 답변 게시판 미션을 위한 저장소","fork":false,"url":"https://api.github.com/repos/code-squad/java-qna","forks_url":"https://api.github.com/repos/code-squad/java-qna/forks","keys_url":"https://api.github.com/repos/code-squad/java-qna/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-squad/java-qna/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-squad/java-qna/teams","hooks_url":"https://api.github.com/repos/code-squad/java-qna/hooks","issue_events_url":"https://api.github.com/repos/code-squad/java-qna/issues/events{/number}","events_url":"https://api.github.com/repos/code-squad/java-qna/events","assignees_url":"https://api.github.com/repos/code-squad/java-qna/assignees{/user}","branches_url":"https://api.github.com/repos/code-squad/java-qna/branches{/branch}","tags_url":"https://api.github.com/repos/code-squad/java-qna/tags","blobs_url":"https://api.github.com/repos/code-squad/java-qna/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-squad/java-qna/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-squad/java-qna/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-squad/java-qna/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-squad/java-qna/statuses/{sha}","languages_url":"https://api.github.com/repos/code-squad/java-qna/languages","stargazers_url":"https://api.github.com/repos/code-squad/java-qna/stargazers","contributors_url":"https://api.github.com/repos/code-squad/java-qna/contributors","subscribers_url":"https://api.github.com/repos/code-squad/java-qna/subscribers","subscription_url":"https://api.github.com/repos/code-squad/java-qna/subscription","commits_url":"https://api.github.com/repos/code-squad/java-qna/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-squad/java-qna/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-squad/java-qna/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-squad/java-qna/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-squad/java-qna/contents/{+path}","compare_url":"https://api.github.com/repos/code-squad/java-qna/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-squad/java-qna/merges","archive_url":"https://api.github.com/repos/code-squad/java-qna/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-squad/java-qna/downloads","issues_url":"https://api.github.com/repos/code-squad/java-qna/issues{/number}","pulls_url":"https://api.github.com/repos/code-squad/java-qna/pulls{/number}","milestones_url":"https://api.github.com/repos/code-squad/java-qna/milestones{/number}","notifications_url":"https://api.github.com/repos/code-squad/java-qna/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-squad/java-qna/labels{/name}","releases_url":"https://api.github.com/repos/code-squad/java-qna/releases{/id}","deployments_url":"https://api.github.com/repos/code-squad/java-qna/deployments","created_at":"2018-03-20T06:32:34Z","updated_at":"2018-05-15T08:12:32Z","pushed_at":"2018-05-29T06:22:29Z","git_url":"git://github.com/code-squad/java-qna.git","ssh_url":"git@github.com:code-squad/java-qna.git","clone_url":"https://github.com/code-squad/java-qna.git","svn_url":"https://github.com/code-squad/java-qna","homepage":null,"size":580,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":10,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/code-squad/java-qna/pulls/46"},"html":{"href":"https://github.com/code-squad/java-qna/pull/46"},"issue":{"href":"https://api.github.com/repos/code-squad/java-qna/issues/46"},"comments":{"href":"https://api.github.com/repos/code-squad/java-qna/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/code-squad/java-qna/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/code-squad/java-qna/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-squad/java-qna/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/code-squad/java-qna/statuses/a1f5476c8afb3175e9002d9a513b364d9220f78f"}},"author_association":"NONE"}}
{"actor":{"display_login":"javajigi"}}