{"action":"created","comment":{"url":"https://api.github.com/repos/strongloop/loopback-next/pulls/comments/201748984","pull_request_review_id":136310765,"id":201748984,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTc0ODk4NA==","diff_hunk":"@@ -0,0 +1,67 @@\n+import {repository, HasManyRepository} from '@loopback/repository';\n+import {TodoListRepository} from '../repositories';\n+import {TodoList, Todo} from '../models';\n+import {requestBody, param, post, get, del, put, patch} from '@loopback/rest';\n+\n+export class TodoListController {\n+  protected todoRepo: HasManyRepository<TodoList>;\n+\n+  constructor(\n+    @repository(TodoListRepository) protected todoListRepo: TodoListRepository,\n+  ) {}\n+\n+  @post('/todo-lists')\n+  async createTodoList() {\n+    const newTodoList = {createdAt: new Date()};\n+    return await this.todoListRepo.create(newTodoList);\n+  }\n+\n+  @get('/todo-lists/{id}')\n+  async findTodoListById(@param.path.number('id') id: number) {\n+    return await this.todoListRepo.findById(id);\n+  }\n+\n+  @get('/todo-lists')\n+  async findTodos() {\n+    return await this.todoListRepo.find();\n+  }\n+\n+  @put('/todo-lists/{id}')\n+  async replaceTodo(\n+    @param.path.number('id') id: number,\n+    @requestBody() todoList: TodoList,\n+  ) {\n+    return await this.todoListRepo.replaceById(id, todoList);\n+  }\n+\n+  @patch('/todo-lists/{id}')\n+  async updateTodo(\n+    @param.path.number('id') id: number,\n+    @requestBody() todoList: TodoList,\n+  ) {\n+    return await this.todoListRepo.updateById(id, todoList);\n+  }\n+\n+  @del('/todo-lists/{id}')\n+  async deleteTodo(@param.path.number('id') id: number) {\n+    return await this.todoListRepo.deleteById(id);","path":"examples/todo-intermediate/src/controllers/todo-list.controller.ts","position":47,"original_position":47,"commit_id":"6fe307d38294c3d612f7b620d906d7618086441c","original_commit_id":"6fe307d38294c3d612f7b620d906d7618086441c","user":{"login":"dhmlau","id":25489897,"node_id":"MDQ6VXNlcjI1NDg5ODk3","avatar_url":"https://avatars3.githubusercontent.com/u/25489897?v=4","gravatar_id":"","url":"https://api.github.com/users/dhmlau","html_url":"https://github.com/dhmlau","followers_url":"https://api.github.com/users/dhmlau/followers","following_url":"https://api.github.com/users/dhmlau/following{/other_user}","gists_url":"https://api.github.com/users/dhmlau/gists{/gist_id}","starred_url":"https://api.github.com/users/dhmlau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhmlau/subscriptions","organizations_url":"https://api.github.com/users/dhmlau/orgs","repos_url":"https://api.github.com/users/dhmlau/repos","events_url":"https://api.github.com/users/dhmlau/events{/privacy}","received_events_url":"https://api.github.com/users/dhmlau/received_events","type":"User","site_admin":false},"body":"I think when deleting a ToDoList, it makes sense to delete the ToDos inside the list as well. ","created_at":"2018-07-11T15:59:07Z","updated_at":"2018-07-11T15:59:07Z","html_url":"https://github.com/strongloop/loopback-next/pull/1518#discussion_r201748984","pull_request_url":"https://api.github.com/repos/strongloop/loopback-next/pulls/1518","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/comments/201748984"},"html":{"href":"https://github.com/strongloop/loopback-next/pull/1518#discussion_r201748984"},"pull_request":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/1518"}},"in_reply_to_id":201738782},"pull_request":{"url":"https://api.github.com/repos/strongloop/loopback-next/pulls/1518","id":200741201,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwNzQxMjAx","html_url":"https://github.com/strongloop/loopback-next/pull/1518","diff_url":"https://github.com/strongloop/loopback-next/pull/1518.diff","patch_url":"https://github.com/strongloop/loopback-next/pull/1518.patch","issue_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1518","number":1518,"state":"open","locked":false,"title":"[WIP] Add TodoList with HasMany relation to Todo","user":{"login":"shimks","id":18518689,"node_id":"MDQ6VXNlcjE4NTE4Njg5","avatar_url":"https://avatars2.githubusercontent.com/u/18518689?v=4","gravatar_id":"","url":"https://api.github.com/users/shimks","html_url":"https://github.com/shimks","followers_url":"https://api.github.com/users/shimks/followers","following_url":"https://api.github.com/users/shimks/following{/other_user}","gists_url":"https://api.github.com/users/shimks/gists{/gist_id}","starred_url":"https://api.github.com/users/shimks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimks/subscriptions","organizations_url":"https://api.github.com/users/shimks/orgs","repos_url":"https://api.github.com/users/shimks/repos","events_url":"https://api.github.com/users/shimks/events{/privacy}","received_events_url":"https://api.github.com/users/shimks/received_events","type":"User","site_admin":false},"body":"related to #1358 \r\n\r\nThis PR is intended to create a separate package from `example-todo` which would incorporate using relations, potentially along with other features coming to loopback-next.\r\n\r\nThe first commit merely copies over files from Todo with no meaningful changes made in between.\r\nPlease review from 2nd commits and onward.\r\n\r\nThings not included in the PR (yet):\r\n- tests\r\n- instructions on creating the app\r\n\r\n## Checklist\r\n\r\n- [ ] `npm test` passes on your machine\r\n- [ ] New tests added or existing tests modified to cover all changes\r\n- [ ] Code conforms with the [style guide](http://loopback.io/doc/en/contrib/style-guide.html)\r\n- [ ] API Documentation in code was updated\r\n- [ ] Documentation in [/docs/site](../tree/master/docs/site) was updated\r\n- [ ] Affected artifact templates in `packages/cli` were updated\r\n- [ ] Affected example projects in `examples/*` were updated\r\n","created_at":"2018-07-11T15:31:28Z","updated_at":"2018-07-11T15:59:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd894bbee4b81dc5d0d738fabc04ccc1277f5e37","assignee":null,"assignees":[],"requested_reviewers":[{"login":"raymondfeng","id":540892,"node_id":"MDQ6VXNlcjU0MDg5Mg==","avatar_url":"https://avatars0.githubusercontent.com/u/540892?v=4","gravatar_id":"","url":"https://api.github.com/users/raymondfeng","html_url":"https://github.com/raymondfeng","followers_url":"https://api.github.com/users/raymondfeng/followers","following_url":"https://api.github.com/users/raymondfeng/following{/other_user}","gists_url":"https://api.github.com/users/raymondfeng/gists{/gist_id}","starred_url":"https://api.github.com/users/raymondfeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raymondfeng/subscriptions","organizations_url":"https://api.github.com/users/raymondfeng/orgs","repos_url":"https://api.github.com/users/raymondfeng/repos","events_url":"https://api.github.com/users/raymondfeng/events{/privacy}","received_events_url":"https://api.github.com/users/raymondfeng/received_events","type":"User","site_admin":false},{"login":"bajtos","id":1140553,"node_id":"MDQ6VXNlcjExNDA1NTM=","avatar_url":"https://avatars1.githubusercontent.com/u/1140553?v=4","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/strongloop/loopback-next/pulls/1518/commits","review_comments_url":"https://api.github.com/repos/strongloop/loopback-next/pulls/1518/comments","review_comment_url":"https://api.github.com/repos/strongloop/loopback-next/pulls/comments{/number}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/issues/1518/comments","statuses_url":"https://api.github.com/repos/strongloop/loopback-next/statuses/6fe307d38294c3d612f7b620d906d7618086441c","head":{"label":"strongloop:todo-relation","ref":"todo-relation","sha":"6fe307d38294c3d612f7b620d906d7618086441c","user":{"login":"strongloop","id":3020012,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjAwMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/3020012?v=4","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":78452015,"node_id":"MDEwOlJlcG9zaXRvcnk3ODQ1MjAxNQ==","name":"loopback-next","full_name":"strongloop/loopback-next","owner":{"login":"strongloop","id":3020012,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjAwMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/3020012?v=4","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/loopback-next","description":"LoopBack makes it easy to build modern API applications that require complex integrations.","fork":false,"url":"https://api.github.com/repos/strongloop/loopback-next","forks_url":"https://api.github.com/repos/strongloop/loopback-next/forks","keys_url":"https://api.github.com/repos/strongloop/loopback-next/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/loopback-next/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/loopback-next/teams","hooks_url":"https://api.github.com/repos/strongloop/loopback-next/hooks","issue_events_url":"https://api.github.com/repos/strongloop/loopback-next/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/loopback-next/events","assignees_url":"https://api.github.com/repos/strongloop/loopback-next/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/loopback-next/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/loopback-next/tags","blobs_url":"https://api.github.com/repos/strongloop/loopback-next/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/loopback-next/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/loopback-next/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/loopback-next/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/loopback-next/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/loopback-next/languages","stargazers_url":"https://api.github.com/repos/strongloop/loopback-next/stargazers","contributors_url":"https://api.github.com/repos/strongloop/loopback-next/contributors","subscribers_url":"https://api.github.com/repos/strongloop/loopback-next/subscribers","subscription_url":"https://api.github.com/repos/strongloop/loopback-next/subscription","commits_url":"https://api.github.com/repos/strongloop/loopback-next/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/loopback-next/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/loopback-next/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/loopback-next/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/loopback-next/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/loopback-next/merges","archive_url":"https://api.github.com/repos/strongloop/loopback-next/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/loopback-next/downloads","issues_url":"https://api.github.com/repos/strongloop/loopback-next/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/loopback-next/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/loopback-next/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/loopback-next/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/loopback-next/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/loopback-next/releases{/id}","deployments_url":"https://api.github.com/repos/strongloop/loopback-next/deployments","created_at":"2017-01-09T17:27:14Z","updated_at":"2018-07-10T22:53:29Z","pushed_at":"2018-07-11T15:31:28Z","git_url":"git://github.com/strongloop/loopback-next.git","ssh_url":"git@github.com:strongloop/loopback-next.git","clone_url":"https://github.com/strongloop/loopback-next.git","svn_url":"https://github.com/strongloop/loopback-next","homepage":"http://loopback.io","size":6871,"stargazers_count":685,"watchers_count":685,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":73,"mirror_url":null,"archived":false,"open_issues_count":248,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":73,"open_issues":248,"watchers":685,"default_branch":"master"}},"base":{"label":"strongloop:master","ref":"master","sha":"29e577a3861198148473dce94701fc29de79df82","user":{"login":"strongloop","id":3020012,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjAwMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/3020012?v=4","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"repo":{"id":78452015,"node_id":"MDEwOlJlcG9zaXRvcnk3ODQ1MjAxNQ==","name":"loopback-next","full_name":"strongloop/loopback-next","owner":{"login":"strongloop","id":3020012,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMwMjAwMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/3020012?v=4","gravatar_id":"","url":"https://api.github.com/users/strongloop","html_url":"https://github.com/strongloop","followers_url":"https://api.github.com/users/strongloop/followers","following_url":"https://api.github.com/users/strongloop/following{/other_user}","gists_url":"https://api.github.com/users/strongloop/gists{/gist_id}","starred_url":"https://api.github.com/users/strongloop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strongloop/subscriptions","organizations_url":"https://api.github.com/users/strongloop/orgs","repos_url":"https://api.github.com/users/strongloop/repos","events_url":"https://api.github.com/users/strongloop/events{/privacy}","received_events_url":"https://api.github.com/users/strongloop/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/strongloop/loopback-next","description":"LoopBack makes it easy to build modern API applications that require complex integrations.","fork":false,"url":"https://api.github.com/repos/strongloop/loopback-next","forks_url":"https://api.github.com/repos/strongloop/loopback-next/forks","keys_url":"https://api.github.com/repos/strongloop/loopback-next/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strongloop/loopback-next/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strongloop/loopback-next/teams","hooks_url":"https://api.github.com/repos/strongloop/loopback-next/hooks","issue_events_url":"https://api.github.com/repos/strongloop/loopback-next/issues/events{/number}","events_url":"https://api.github.com/repos/strongloop/loopback-next/events","assignees_url":"https://api.github.com/repos/strongloop/loopback-next/assignees{/user}","branches_url":"https://api.github.com/repos/strongloop/loopback-next/branches{/branch}","tags_url":"https://api.github.com/repos/strongloop/loopback-next/tags","blobs_url":"https://api.github.com/repos/strongloop/loopback-next/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strongloop/loopback-next/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strongloop/loopback-next/git/refs{/sha}","trees_url":"https://api.github.com/repos/strongloop/loopback-next/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strongloop/loopback-next/statuses/{sha}","languages_url":"https://api.github.com/repos/strongloop/loopback-next/languages","stargazers_url":"https://api.github.com/repos/strongloop/loopback-next/stargazers","contributors_url":"https://api.github.com/repos/strongloop/loopback-next/contributors","subscribers_url":"https://api.github.com/repos/strongloop/loopback-next/subscribers","subscription_url":"https://api.github.com/repos/strongloop/loopback-next/subscription","commits_url":"https://api.github.com/repos/strongloop/loopback-next/commits{/sha}","git_commits_url":"https://api.github.com/repos/strongloop/loopback-next/git/commits{/sha}","comments_url":"https://api.github.com/repos/strongloop/loopback-next/comments{/number}","issue_comment_url":"https://api.github.com/repos/strongloop/loopback-next/issues/comments{/number}","contents_url":"https://api.github.com/repos/strongloop/loopback-next/contents/{+path}","compare_url":"https://api.github.com/repos/strongloop/loopback-next/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strongloop/loopback-next/merges","archive_url":"https://api.github.com/repos/strongloop/loopback-next/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strongloop/loopback-next/downloads","issues_url":"https://api.github.com/repos/strongloop/loopback-next/issues{/number}","pulls_url":"https://api.github.com/repos/strongloop/loopback-next/pulls{/number}","milestones_url":"https://api.github.com/repos/strongloop/loopback-next/milestones{/number}","notifications_url":"https://api.github.com/repos/strongloop/loopback-next/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strongloop/loopback-next/labels{/name}","releases_url":"https://api.github.com/repos/strongloop/loopback-next/releases{/id}","deployments_url":"https://api.github.com/repos/strongloop/loopback-next/deployments","created_at":"2017-01-09T17:27:14Z","updated_at":"2018-07-10T22:53:29Z","pushed_at":"2018-07-11T15:31:28Z","git_url":"git://github.com/strongloop/loopback-next.git","ssh_url":"git@github.com:strongloop/loopback-next.git","clone_url":"https://github.com/strongloop/loopback-next.git","svn_url":"https://github.com/strongloop/loopback-next","homepage":"http://loopback.io","size":6871,"stargazers_count":685,"watchers_count":685,"language":"TypeScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":73,"mirror_url":null,"archived":false,"open_issues_count":248,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":73,"open_issues":248,"watchers":685,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/1518"},"html":{"href":"https://github.com/strongloop/loopback-next/pull/1518"},"issue":{"href":"https://api.github.com/repos/strongloop/loopback-next/issues/1518"},"comments":{"href":"https://api.github.com/repos/strongloop/loopback-next/issues/1518/comments"},"review_comments":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/1518/comments"},"review_comment":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/strongloop/loopback-next/pulls/1518/commits"},"statuses":{"href":"https://api.github.com/repos/strongloop/loopback-next/statuses/6fe307d38294c3d612f7b620d906d7618086441c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dhmlau"}}