{"action":"created","comment":{"url":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/comments/190577447","pull_request_review_id":122981545,"id":190577447,"diff_hunk":"@@ -38,16 +38,28 @@ module.exports = {\n         }\n     },\n \n-    removeImage(req, res, image_url) {\n+    removeImage(req, res, image_url, replaced=false) {\n         try {\n             fs.unlinkSync(__dirname + '/' + image_url);\n-            res.status(200).send('Successfully removed an image.');\n+            if (replaced) { \n+                console.log('Successfully replaced image.');\n+            } else {\n+                res.status(200).send('Successfully removed an image.');\n+            }\n         } catch (err){\n             if (err.errno == -2){\n-                res.status(200).send('Image already removed.');\n+                if (replaced) { \n+                    console.log('Replace: Image already removed.');\n+                } else {\n+                    res.status(200).send('Image already removed.');\n+                }\n             }\n             else {\n-                res.status(500).send(err);\n+                if (replaced) { \n+                    console.log(err);\n+                } else {\n+                    res.status(500).send(err);\n+                }","path":"images/Image.js","position":29,"original_position":29,"commit_id":"1d1e99ae0680d311b8cbe20d170f317e2422fc73","original_commit_id":"1d1e99ae0680d311b8cbe20d170f317e2422fc73","user":{"login":"BlueDi","id":9451036,"avatar_url":"https://avatars3.githubusercontent.com/u/9451036?v=4","gravatar_id":"","url":"https://api.github.com/users/BlueDi","html_url":"https://github.com/BlueDi","followers_url":"https://api.github.com/users/BlueDi/followers","following_url":"https://api.github.com/users/BlueDi/following{/other_user}","gists_url":"https://api.github.com/users/BlueDi/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueDi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueDi/subscriptions","organizations_url":"https://api.github.com/users/BlueDi/orgs","repos_url":"https://api.github.com/users/BlueDi/repos","events_url":"https://api.github.com/users/BlueDi/events{/privacy}","received_events_url":"https://api.github.com/users/BlueDi/received_events","type":"User","site_admin":false},"body":"Acho que se apanhou um erro deve enviar na mesma o 500.","created_at":"2018-05-24T13:05:28Z","updated_at":"2018-05-24T13:05:28Z","html_url":"https://github.com/cubicon-feup/mygrant/pull/60#discussion_r190577447","pull_request_url":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/60","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/comments/190577447"},"html":{"href":"https://github.com/cubicon-feup/mygrant/pull/60#discussion_r190577447"},"pull_request":{"href":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/60","id":190268221,"html_url":"https://github.com/cubicon-feup/mygrant/pull/60","diff_url":"https://github.com/cubicon-feup/mygrant/pull/60.diff","patch_url":"https://github.com/cubicon-feup/mygrant/pull/60.patch","issue_url":"https://api.github.com/repos/cubicon-feup/mygrant/issues/60","number":60,"state":"open","locked":false,"title":"Added api to allow change to user image","user":{"login":"diogoseca","id":6810578,"avatar_url":"https://avatars1.githubusercontent.com/u/6810578?v=4","gravatar_id":"","url":"https://api.github.com/users/diogoseca","html_url":"https://github.com/diogoseca","followers_url":"https://api.github.com/users/diogoseca/followers","following_url":"https://api.github.com/users/diogoseca/following{/other_user}","gists_url":"https://api.github.com/users/diogoseca/gists{/gist_id}","starred_url":"https://api.github.com/users/diogoseca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diogoseca/subscriptions","organizations_url":"https://api.github.com/users/diogoseca/orgs","repos_url":"https://api.github.com/users/diogoseca/repos","events_url":"https://api.github.com/users/diogoseca/events{/privacy}","received_events_url":"https://api.github.com/users/diogoseca/received_events","type":"User","site_admin":false},"body":"* Updates database\n* Updates local files","created_at":"2018-05-24T12:15:54Z","updated_at":"2018-05-24T13:05:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8902d69f2e14b3f2a3e70b0db2fabcbd2ef25bae","assignee":{"login":"diogoseca","id":6810578,"avatar_url":"https://avatars1.githubusercontent.com/u/6810578?v=4","gravatar_id":"","url":"https://api.github.com/users/diogoseca","html_url":"https://github.com/diogoseca","followers_url":"https://api.github.com/users/diogoseca/followers","following_url":"https://api.github.com/users/diogoseca/following{/other_user}","gists_url":"https://api.github.com/users/diogoseca/gists{/gist_id}","starred_url":"https://api.github.com/users/diogoseca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diogoseca/subscriptions","organizations_url":"https://api.github.com/users/diogoseca/orgs","repos_url":"https://api.github.com/users/diogoseca/repos","events_url":"https://api.github.com/users/diogoseca/events{/privacy}","received_events_url":"https://api.github.com/users/diogoseca/received_events","type":"User","site_admin":false},"assignees":[{"login":"diogoseca","id":6810578,"avatar_url":"https://avatars1.githubusercontent.com/u/6810578?v=4","gravatar_id":"","url":"https://api.github.com/users/diogoseca","html_url":"https://github.com/diogoseca","followers_url":"https://api.github.com/users/diogoseca/followers","following_url":"https://api.github.com/users/diogoseca/following{/other_user}","gists_url":"https://api.github.com/users/diogoseca/gists{/gist_id}","starred_url":"https://api.github.com/users/diogoseca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diogoseca/subscriptions","organizations_url":"https://api.github.com/users/diogoseca/orgs","repos_url":"https://api.github.com/users/diogoseca/repos","events_url":"https://api.github.com/users/diogoseca/events{/privacy}","received_events_url":"https://api.github.com/users/diogoseca/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"edgarlpassos","id":14338539,"avatar_url":"https://avatars2.githubusercontent.com/u/14338539?v=4","gravatar_id":"","url":"https://api.github.com/users/edgarlpassos","html_url":"https://github.com/edgarlpassos","followers_url":"https://api.github.com/users/edgarlpassos/followers","following_url":"https://api.github.com/users/edgarlpassos/following{/other_user}","gists_url":"https://api.github.com/users/edgarlpassos/gists{/gist_id}","starred_url":"https://api.github.com/users/edgarlpassos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgarlpassos/subscriptions","organizations_url":"https://api.github.com/users/edgarlpassos/orgs","repos_url":"https://api.github.com/users/edgarlpassos/repos","events_url":"https://api.github.com/users/edgarlpassos/events{/privacy}","received_events_url":"https://api.github.com/users/edgarlpassos/received_events","type":"User","site_admin":false},{"login":"BSantos22","id":16957659,"avatar_url":"https://avatars0.githubusercontent.com/u/16957659?v=4","gravatar_id":"","url":"https://api.github.com/users/BSantos22","html_url":"https://github.com/BSantos22","followers_url":"https://api.github.com/users/BSantos22/followers","following_url":"https://api.github.com/users/BSantos22/following{/other_user}","gists_url":"https://api.github.com/users/BSantos22/gists{/gist_id}","starred_url":"https://api.github.com/users/BSantos22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BSantos22/subscriptions","organizations_url":"https://api.github.com/users/BSantos22/orgs","repos_url":"https://api.github.com/users/BSantos22/repos","events_url":"https://api.github.com/users/BSantos22/events{/privacy}","received_events_url":"https://api.github.com/users/BSantos22/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":895444852,"url":"https://api.github.com/repos/cubicon-feup/mygrant/labels/backend","name":"backend","color":"90C53F","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/60/commits","review_comments_url":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/60/comments","review_comment_url":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cubicon-feup/mygrant/issues/60/comments","statuses_url":"https://api.github.com/repos/cubicon-feup/mygrant/statuses/1d1e99ae0680d311b8cbe20d170f317e2422fc73","head":{"label":"cubicon-feup:feature/change-user-image","ref":"feature/change-user-image","sha":"1d1e99ae0680d311b8cbe20d170f317e2422fc73","user":{"login":"cubicon-feup","id":37418620,"avatar_url":"https://avatars2.githubusercontent.com/u/37418620?v=4","gravatar_id":"","url":"https://api.github.com/users/cubicon-feup","html_url":"https://github.com/cubicon-feup","followers_url":"https://api.github.com/users/cubicon-feup/followers","following_url":"https://api.github.com/users/cubicon-feup/following{/other_user}","gists_url":"https://api.github.com/users/cubicon-feup/gists{/gist_id}","starred_url":"https://api.github.com/users/cubicon-feup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubicon-feup/subscriptions","organizations_url":"https://api.github.com/users/cubicon-feup/orgs","repos_url":"https://api.github.com/users/cubicon-feup/repos","events_url":"https://api.github.com/users/cubicon-feup/events{/privacy}","received_events_url":"https://api.github.com/users/cubicon-feup/received_events","type":"Organization","site_admin":false},"repo":{"id":127640515,"name":"mygrant","full_name":"cubicon-feup/mygrant","owner":{"login":"cubicon-feup","id":37418620,"avatar_url":"https://avatars2.githubusercontent.com/u/37418620?v=4","gravatar_id":"","url":"https://api.github.com/users/cubicon-feup","html_url":"https://github.com/cubicon-feup","followers_url":"https://api.github.com/users/cubicon-feup/followers","following_url":"https://api.github.com/users/cubicon-feup/following{/other_user}","gists_url":"https://api.github.com/users/cubicon-feup/gists{/gist_id}","starred_url":"https://api.github.com/users/cubicon-feup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubicon-feup/subscriptions","organizations_url":"https://api.github.com/users/cubicon-feup/orgs","repos_url":"https://api.github.com/users/cubicon-feup/repos","events_url":"https://api.github.com/users/cubicon-feup/events{/privacy}","received_events_url":"https://api.github.com/users/cubicon-feup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cubicon-feup/mygrant","description":null,"fork":false,"url":"https://api.github.com/repos/cubicon-feup/mygrant","forks_url":"https://api.github.com/repos/cubicon-feup/mygrant/forks","keys_url":"https://api.github.com/repos/cubicon-feup/mygrant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cubicon-feup/mygrant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cubicon-feup/mygrant/teams","hooks_url":"https://api.github.com/repos/cubicon-feup/mygrant/hooks","issue_events_url":"https://api.github.com/repos/cubicon-feup/mygrant/issues/events{/number}","events_url":"https://api.github.com/repos/cubicon-feup/mygrant/events","assignees_url":"https://api.github.com/repos/cubicon-feup/mygrant/assignees{/user}","branches_url":"https://api.github.com/repos/cubicon-feup/mygrant/branches{/branch}","tags_url":"https://api.github.com/repos/cubicon-feup/mygrant/tags","blobs_url":"https://api.github.com/repos/cubicon-feup/mygrant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cubicon-feup/mygrant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cubicon-feup/mygrant/git/refs{/sha}","trees_url":"https://api.github.com/repos/cubicon-feup/mygrant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cubicon-feup/mygrant/statuses/{sha}","languages_url":"https://api.github.com/repos/cubicon-feup/mygrant/languages","stargazers_url":"https://api.github.com/repos/cubicon-feup/mygrant/stargazers","contributors_url":"https://api.github.com/repos/cubicon-feup/mygrant/contributors","subscribers_url":"https://api.github.com/repos/cubicon-feup/mygrant/subscribers","subscription_url":"https://api.github.com/repos/cubicon-feup/mygrant/subscription","commits_url":"https://api.github.com/repos/cubicon-feup/mygrant/commits{/sha}","git_commits_url":"https://api.github.com/repos/cubicon-feup/mygrant/git/commits{/sha}","comments_url":"https://api.github.com/repos/cubicon-feup/mygrant/comments{/number}","issue_comment_url":"https://api.github.com/repos/cubicon-feup/mygrant/issues/comments{/number}","contents_url":"https://api.github.com/repos/cubicon-feup/mygrant/contents/{+path}","compare_url":"https://api.github.com/repos/cubicon-feup/mygrant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cubicon-feup/mygrant/merges","archive_url":"https://api.github.com/repos/cubicon-feup/mygrant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cubicon-feup/mygrant/downloads","issues_url":"https://api.github.com/repos/cubicon-feup/mygrant/issues{/number}","pulls_url":"https://api.github.com/repos/cubicon-feup/mygrant/pulls{/number}","milestones_url":"https://api.github.com/repos/cubicon-feup/mygrant/milestones{/number}","notifications_url":"https://api.github.com/repos/cubicon-feup/mygrant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cubicon-feup/mygrant/labels{/name}","releases_url":"https://api.github.com/repos/cubicon-feup/mygrant/releases{/id}","deployments_url":"https://api.github.com/repos/cubicon-feup/mygrant/deployments","created_at":"2018-04-01T15:12:53Z","updated_at":"2018-05-05T07:08:14Z","pushed_at":"2018-05-24T12:15:55Z","git_url":"git://github.com/cubicon-feup/mygrant.git","ssh_url":"git@github.com:cubicon-feup/mygrant.git","clone_url":"https://github.com/cubicon-feup/mygrant.git","svn_url":"https://github.com/cubicon-feup/mygrant","homepage":null,"size":2084,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"cubicon-feup:develop","ref":"develop","sha":"4ebb61038ea9bbb33d142ddfd7bc936b931565df","user":{"login":"cubicon-feup","id":37418620,"avatar_url":"https://avatars2.githubusercontent.com/u/37418620?v=4","gravatar_id":"","url":"https://api.github.com/users/cubicon-feup","html_url":"https://github.com/cubicon-feup","followers_url":"https://api.github.com/users/cubicon-feup/followers","following_url":"https://api.github.com/users/cubicon-feup/following{/other_user}","gists_url":"https://api.github.com/users/cubicon-feup/gists{/gist_id}","starred_url":"https://api.github.com/users/cubicon-feup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubicon-feup/subscriptions","organizations_url":"https://api.github.com/users/cubicon-feup/orgs","repos_url":"https://api.github.com/users/cubicon-feup/repos","events_url":"https://api.github.com/users/cubicon-feup/events{/privacy}","received_events_url":"https://api.github.com/users/cubicon-feup/received_events","type":"Organization","site_admin":false},"repo":{"id":127640515,"name":"mygrant","full_name":"cubicon-feup/mygrant","owner":{"login":"cubicon-feup","id":37418620,"avatar_url":"https://avatars2.githubusercontent.com/u/37418620?v=4","gravatar_id":"","url":"https://api.github.com/users/cubicon-feup","html_url":"https://github.com/cubicon-feup","followers_url":"https://api.github.com/users/cubicon-feup/followers","following_url":"https://api.github.com/users/cubicon-feup/following{/other_user}","gists_url":"https://api.github.com/users/cubicon-feup/gists{/gist_id}","starred_url":"https://api.github.com/users/cubicon-feup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cubicon-feup/subscriptions","organizations_url":"https://api.github.com/users/cubicon-feup/orgs","repos_url":"https://api.github.com/users/cubicon-feup/repos","events_url":"https://api.github.com/users/cubicon-feup/events{/privacy}","received_events_url":"https://api.github.com/users/cubicon-feup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cubicon-feup/mygrant","description":null,"fork":false,"url":"https://api.github.com/repos/cubicon-feup/mygrant","forks_url":"https://api.github.com/repos/cubicon-feup/mygrant/forks","keys_url":"https://api.github.com/repos/cubicon-feup/mygrant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cubicon-feup/mygrant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cubicon-feup/mygrant/teams","hooks_url":"https://api.github.com/repos/cubicon-feup/mygrant/hooks","issue_events_url":"https://api.github.com/repos/cubicon-feup/mygrant/issues/events{/number}","events_url":"https://api.github.com/repos/cubicon-feup/mygrant/events","assignees_url":"https://api.github.com/repos/cubicon-feup/mygrant/assignees{/user}","branches_url":"https://api.github.com/repos/cubicon-feup/mygrant/branches{/branch}","tags_url":"https://api.github.com/repos/cubicon-feup/mygrant/tags","blobs_url":"https://api.github.com/repos/cubicon-feup/mygrant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cubicon-feup/mygrant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cubicon-feup/mygrant/git/refs{/sha}","trees_url":"https://api.github.com/repos/cubicon-feup/mygrant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cubicon-feup/mygrant/statuses/{sha}","languages_url":"https://api.github.com/repos/cubicon-feup/mygrant/languages","stargazers_url":"https://api.github.com/repos/cubicon-feup/mygrant/stargazers","contributors_url":"https://api.github.com/repos/cubicon-feup/mygrant/contributors","subscribers_url":"https://api.github.com/repos/cubicon-feup/mygrant/subscribers","subscription_url":"https://api.github.com/repos/cubicon-feup/mygrant/subscription","commits_url":"https://api.github.com/repos/cubicon-feup/mygrant/commits{/sha}","git_commits_url":"https://api.github.com/repos/cubicon-feup/mygrant/git/commits{/sha}","comments_url":"https://api.github.com/repos/cubicon-feup/mygrant/comments{/number}","issue_comment_url":"https://api.github.com/repos/cubicon-feup/mygrant/issues/comments{/number}","contents_url":"https://api.github.com/repos/cubicon-feup/mygrant/contents/{+path}","compare_url":"https://api.github.com/repos/cubicon-feup/mygrant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cubicon-feup/mygrant/merges","archive_url":"https://api.github.com/repos/cubicon-feup/mygrant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cubicon-feup/mygrant/downloads","issues_url":"https://api.github.com/repos/cubicon-feup/mygrant/issues{/number}","pulls_url":"https://api.github.com/repos/cubicon-feup/mygrant/pulls{/number}","milestones_url":"https://api.github.com/repos/cubicon-feup/mygrant/milestones{/number}","notifications_url":"https://api.github.com/repos/cubicon-feup/mygrant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cubicon-feup/mygrant/labels{/name}","releases_url":"https://api.github.com/repos/cubicon-feup/mygrant/releases{/id}","deployments_url":"https://api.github.com/repos/cubicon-feup/mygrant/deployments","created_at":"2018-04-01T15:12:53Z","updated_at":"2018-05-05T07:08:14Z","pushed_at":"2018-05-24T12:15:55Z","git_url":"git://github.com/cubicon-feup/mygrant.git","ssh_url":"git@github.com:cubicon-feup/mygrant.git","clone_url":"https://github.com/cubicon-feup/mygrant.git","svn_url":"https://github.com/cubicon-feup/mygrant","homepage":null,"size":2084,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/60"},"html":{"href":"https://github.com/cubicon-feup/mygrant/pull/60"},"issue":{"href":"https://api.github.com/repos/cubicon-feup/mygrant/issues/60"},"comments":{"href":"https://api.github.com/repos/cubicon-feup/mygrant/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cubicon-feup/mygrant/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/cubicon-feup/mygrant/statuses/1d1e99ae0680d311b8cbe20d170f317e2422fc73"}},"author_association":"NONE"}}
{"actor":{"display_login":"BlueDi"}}