{"action":"created","comment":{"url":"https://api.github.com/repos/Webiks/tb/pulls/comments/230581983","pull_request_review_id":171355543,"id":230581983,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMDU4MTk4Mw==","diff_hunk":"@@ -0,0 +1,76 @@\n+const gsUtils = require('../geoserverCrud/gsUtils');\n+const worldModel = require('../../database/schemas/WorldSchema');\n+const layerModel = require('../../database/schemas/LayerSchema');\n+const MongoCrud = require('../../database/MongoCrud');\n+\n+const dbWorldCrud = new MongoCrud(worldModel);\n+const dbLayerCrud = new MongoCrud(layerModel);\n+\n+// Handle ERRORS\n+const handleError = (res, status, consoleMessage, sendMessage) => {\n+\tconsole.error('db Layer: ' + consoleMessage);\n+\tres.status(status).send(sendMessage);\n+};\n+\n+// remove the layer only if it doesn't exist in another world (from the DataBase and from Geosewrver)\n+const removeLayer = (layerId, worldId) => {\n+\t// 1. get all the worlds except to the current world\n+\treturn dbWorldCrud.getAll().then(worlds => worlds.filter(world => world._id !== worldId))","path":"server/src/api/databaseCrud/dbUtils.js","position":18,"original_position":18,"commit_id":"0ef93b13280174d04bb1b4f53e3e0f130005a218","original_commit_id":"0ef93b13280174d04bb1b4f53e3e0f130005a218","user":{"login":"yairtawil","id":10003115,"node_id":"MDQ6VXNlcjEwMDAzMTE1","avatar_url":"https://avatars1.githubusercontent.com/u/10003115?v=4","gravatar_id":"","url":"https://api.github.com/users/yairtawil","html_url":"https://github.com/yairtawil","followers_url":"https://api.github.com/users/yairtawil/followers","following_url":"https://api.github.com/users/yairtawil/following{/other_user}","gists_url":"https://api.github.com/users/yairtawil/gists{/gist_id}","starred_url":"https://api.github.com/users/yairtawil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yairtawil/subscriptions","organizations_url":"https://api.github.com/users/yairtawil/orgs","repos_url":"https://api.github.com/users/yairtawil/repos","events_url":"https://api.github.com/users/yairtawil/events{/privacy}","received_events_url":"https://api.github.com/users/yairtawil/received_events","type":"User","site_admin":false},"body":"get from mongo instead of filter","created_at":"2018-11-04T09:52:13Z","updated_at":"2018-11-04T09:54:38Z","html_url":"https://github.com/Webiks/tb/pull/50#discussion_r230581983","pull_request_url":"https://api.github.com/repos/Webiks/tb/pulls/50","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Webiks/tb/pulls/comments/230581983"},"html":{"href":"https://github.com/Webiks/tb/pull/50#discussion_r230581983"},"pull_request":{"href":"https://api.github.com/repos/Webiks/tb/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/Webiks/tb/pulls/50","id":228166246,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4MTY2MjQ2","html_url":"https://github.com/Webiks/tb/pull/50","diff_url":"https://github.com/Webiks/tb/pull/50.diff","patch_url":"https://github.com/Webiks/tb/pull/50.patch","issue_url":"https://api.github.com/repos/Webiks/tb/issues/50","number":50,"state":"open","locked":false,"title":"server: save JPG file data to mongodb","user":{"login":"dafnaweiss","id":37504470,"node_id":"MDQ6VXNlcjM3NTA0NDcw","avatar_url":"https://avatars2.githubusercontent.com/u/37504470?v=4","gravatar_id":"","url":"https://api.github.com/users/dafnaweiss","html_url":"https://github.com/dafnaweiss","followers_url":"https://api.github.com/users/dafnaweiss/followers","following_url":"https://api.github.com/users/dafnaweiss/following{/other_user}","gists_url":"https://api.github.com/users/dafnaweiss/gists{/gist_id}","starred_url":"https://api.github.com/users/dafnaweiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dafnaweiss/subscriptions","organizations_url":"https://api.github.com/users/dafnaweiss/orgs","repos_url":"https://api.github.com/users/dafnaweiss/repos","events_url":"https://api.github.com/users/dafnaweiss/events{/privacy}","received_events_url":"https://api.github.com/users/dafnaweiss/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-04T09:28:33Z","updated_at":"2018-11-04T09:54:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8aca44441f0124f1f91791da0990b29e1a13a1d6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Webiks/tb/pulls/50/commits","review_comments_url":"https://api.github.com/repos/Webiks/tb/pulls/50/comments","review_comment_url":"https://api.github.com/repos/Webiks/tb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Webiks/tb/issues/50/comments","statuses_url":"https://api.github.com/repos/Webiks/tb/statuses/0ef93b13280174d04bb1b4f53e3e0f130005a218","head":{"label":"Webiks:save-image-layer-to-mongo","ref":"save-image-layer-to-mongo","sha":"0ef93b13280174d04bb1b4f53e3e0f130005a218","user":{"login":"Webiks","id":17362975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MzYyOTc1","avatar_url":"https://avatars3.githubusercontent.com/u/17362975?v=4","gravatar_id":"","url":"https://api.github.com/users/Webiks","html_url":"https://github.com/Webiks","followers_url":"https://api.github.com/users/Webiks/followers","following_url":"https://api.github.com/users/Webiks/following{/other_user}","gists_url":"https://api.github.com/users/Webiks/gists{/gist_id}","starred_url":"https://api.github.com/users/Webiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Webiks/subscriptions","organizations_url":"https://api.github.com/users/Webiks/orgs","repos_url":"https://api.github.com/users/Webiks/repos","events_url":"https://api.github.com/users/Webiks/events{/privacy}","received_events_url":"https://api.github.com/users/Webiks/received_events","type":"Organization","site_admin":false},"repo":{"id":139006057,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkwMDYwNTc=","name":"tb","full_name":"Webiks/tb","private":false,"owner":{"login":"Webiks","id":17362975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MzYyOTc1","avatar_url":"https://avatars3.githubusercontent.com/u/17362975?v=4","gravatar_id":"","url":"https://api.github.com/users/Webiks","html_url":"https://github.com/Webiks","followers_url":"https://api.github.com/users/Webiks/followers","following_url":"https://api.github.com/users/Webiks/following{/other_user}","gists_url":"https://api.github.com/users/Webiks/gists{/gist_id}","starred_url":"https://api.github.com/users/Webiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Webiks/subscriptions","organizations_url":"https://api.github.com/users/Webiks/orgs","repos_url":"https://api.github.com/users/Webiks/repos","events_url":"https://api.github.com/users/Webiks/events{/privacy}","received_events_url":"https://api.github.com/users/Webiks/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Webiks/tb","description":null,"fork":false,"url":"https://api.github.com/repos/Webiks/tb","forks_url":"https://api.github.com/repos/Webiks/tb/forks","keys_url":"https://api.github.com/repos/Webiks/tb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Webiks/tb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Webiks/tb/teams","hooks_url":"https://api.github.com/repos/Webiks/tb/hooks","issue_events_url":"https://api.github.com/repos/Webiks/tb/issues/events{/number}","events_url":"https://api.github.com/repos/Webiks/tb/events","assignees_url":"https://api.github.com/repos/Webiks/tb/assignees{/user}","branches_url":"https://api.github.com/repos/Webiks/tb/branches{/branch}","tags_url":"https://api.github.com/repos/Webiks/tb/tags","blobs_url":"https://api.github.com/repos/Webiks/tb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Webiks/tb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Webiks/tb/git/refs{/sha}","trees_url":"https://api.github.com/repos/Webiks/tb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Webiks/tb/statuses/{sha}","languages_url":"https://api.github.com/repos/Webiks/tb/languages","stargazers_url":"https://api.github.com/repos/Webiks/tb/stargazers","contributors_url":"https://api.github.com/repos/Webiks/tb/contributors","subscribers_url":"https://api.github.com/repos/Webiks/tb/subscribers","subscription_url":"https://api.github.com/repos/Webiks/tb/subscription","commits_url":"https://api.github.com/repos/Webiks/tb/commits{/sha}","git_commits_url":"https://api.github.com/repos/Webiks/tb/git/commits{/sha}","comments_url":"https://api.github.com/repos/Webiks/tb/comments{/number}","issue_comment_url":"https://api.github.com/repos/Webiks/tb/issues/comments{/number}","contents_url":"https://api.github.com/repos/Webiks/tb/contents/{+path}","compare_url":"https://api.github.com/repos/Webiks/tb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Webiks/tb/merges","archive_url":"https://api.github.com/repos/Webiks/tb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Webiks/tb/downloads","issues_url":"https://api.github.com/repos/Webiks/tb/issues{/number}","pulls_url":"https://api.github.com/repos/Webiks/tb/pulls{/number}","milestones_url":"https://api.github.com/repos/Webiks/tb/milestones{/number}","notifications_url":"https://api.github.com/repos/Webiks/tb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Webiks/tb/labels{/name}","releases_url":"https://api.github.com/repos/Webiks/tb/releases{/id}","deployments_url":"https://api.github.com/repos/Webiks/tb/deployments","created_at":"2018-06-28T10:55:47Z","updated_at":"2018-11-04T09:13:47Z","pushed_at":"2018-11-04T09:36:22Z","git_url":"git://github.com/Webiks/tb.git","ssh_url":"git@github.com:Webiks/tb.git","clone_url":"https://github.com/Webiks/tb.git","svn_url":"https://github.com/Webiks/tb","homepage":null,"size":586,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":8,"license":null,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"base":{"label":"Webiks:master","ref":"master","sha":"feb9fb531f58555524c5f9ab3a00f0f4e697ecda","user":{"login":"Webiks","id":17362975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MzYyOTc1","avatar_url":"https://avatars3.githubusercontent.com/u/17362975?v=4","gravatar_id":"","url":"https://api.github.com/users/Webiks","html_url":"https://github.com/Webiks","followers_url":"https://api.github.com/users/Webiks/followers","following_url":"https://api.github.com/users/Webiks/following{/other_user}","gists_url":"https://api.github.com/users/Webiks/gists{/gist_id}","starred_url":"https://api.github.com/users/Webiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Webiks/subscriptions","organizations_url":"https://api.github.com/users/Webiks/orgs","repos_url":"https://api.github.com/users/Webiks/repos","events_url":"https://api.github.com/users/Webiks/events{/privacy}","received_events_url":"https://api.github.com/users/Webiks/received_events","type":"Organization","site_admin":false},"repo":{"id":139006057,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkwMDYwNTc=","name":"tb","full_name":"Webiks/tb","private":false,"owner":{"login":"Webiks","id":17362975,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE3MzYyOTc1","avatar_url":"https://avatars3.githubusercontent.com/u/17362975?v=4","gravatar_id":"","url":"https://api.github.com/users/Webiks","html_url":"https://github.com/Webiks","followers_url":"https://api.github.com/users/Webiks/followers","following_url":"https://api.github.com/users/Webiks/following{/other_user}","gists_url":"https://api.github.com/users/Webiks/gists{/gist_id}","starred_url":"https://api.github.com/users/Webiks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Webiks/subscriptions","organizations_url":"https://api.github.com/users/Webiks/orgs","repos_url":"https://api.github.com/users/Webiks/repos","events_url":"https://api.github.com/users/Webiks/events{/privacy}","received_events_url":"https://api.github.com/users/Webiks/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Webiks/tb","description":null,"fork":false,"url":"https://api.github.com/repos/Webiks/tb","forks_url":"https://api.github.com/repos/Webiks/tb/forks","keys_url":"https://api.github.com/repos/Webiks/tb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Webiks/tb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Webiks/tb/teams","hooks_url":"https://api.github.com/repos/Webiks/tb/hooks","issue_events_url":"https://api.github.com/repos/Webiks/tb/issues/events{/number}","events_url":"https://api.github.com/repos/Webiks/tb/events","assignees_url":"https://api.github.com/repos/Webiks/tb/assignees{/user}","branches_url":"https://api.github.com/repos/Webiks/tb/branches{/branch}","tags_url":"https://api.github.com/repos/Webiks/tb/tags","blobs_url":"https://api.github.com/repos/Webiks/tb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Webiks/tb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Webiks/tb/git/refs{/sha}","trees_url":"https://api.github.com/repos/Webiks/tb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Webiks/tb/statuses/{sha}","languages_url":"https://api.github.com/repos/Webiks/tb/languages","stargazers_url":"https://api.github.com/repos/Webiks/tb/stargazers","contributors_url":"https://api.github.com/repos/Webiks/tb/contributors","subscribers_url":"https://api.github.com/repos/Webiks/tb/subscribers","subscription_url":"https://api.github.com/repos/Webiks/tb/subscription","commits_url":"https://api.github.com/repos/Webiks/tb/commits{/sha}","git_commits_url":"https://api.github.com/repos/Webiks/tb/git/commits{/sha}","comments_url":"https://api.github.com/repos/Webiks/tb/comments{/number}","issue_comment_url":"https://api.github.com/repos/Webiks/tb/issues/comments{/number}","contents_url":"https://api.github.com/repos/Webiks/tb/contents/{+path}","compare_url":"https://api.github.com/repos/Webiks/tb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Webiks/tb/merges","archive_url":"https://api.github.com/repos/Webiks/tb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Webiks/tb/downloads","issues_url":"https://api.github.com/repos/Webiks/tb/issues{/number}","pulls_url":"https://api.github.com/repos/Webiks/tb/pulls{/number}","milestones_url":"https://api.github.com/repos/Webiks/tb/milestones{/number}","notifications_url":"https://api.github.com/repos/Webiks/tb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Webiks/tb/labels{/name}","releases_url":"https://api.github.com/repos/Webiks/tb/releases{/id}","deployments_url":"https://api.github.com/repos/Webiks/tb/deployments","created_at":"2018-06-28T10:55:47Z","updated_at":"2018-11-04T09:13:47Z","pushed_at":"2018-11-04T09:36:22Z","git_url":"git://github.com/Webiks/tb.git","ssh_url":"git@github.com:Webiks/tb.git","clone_url":"https://github.com/Webiks/tb.git","svn_url":"https://github.com/Webiks/tb","homepage":null,"size":586,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","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":8,"license":null,"forks":0,"open_issues":8,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Webiks/tb/pulls/50"},"html":{"href":"https://github.com/Webiks/tb/pull/50"},"issue":{"href":"https://api.github.com/repos/Webiks/tb/issues/50"},"comments":{"href":"https://api.github.com/repos/Webiks/tb/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/Webiks/tb/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/Webiks/tb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Webiks/tb/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/Webiks/tb/statuses/0ef93b13280174d04bb1b4f53e3e0f130005a218"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"yairtawil"}}