{"action":"created","issue":{"url":"https://api.github.com/repos/mbouclas/loopback-ds-tree-mixin/issues/1","repository_url":"https://api.github.com/repos/mbouclas/loopback-ds-tree-mixin","labels_url":"https://api.github.com/repos/mbouclas/loopback-ds-tree-mixin/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/mbouclas/loopback-ds-tree-mixin/issues/1/comments","events_url":"https://api.github.com/repos/mbouclas/loopback-ds-tree-mixin/issues/1/events","html_url":"https://github.com/mbouclas/loopback-ds-tree-mixin/issues/1","id":159105817,"number":1,"title":"Creating a root node","user":{"login":"martin-spinks","id":8573062,"avatar_url":"https://avatars.githubusercontent.com/u/8573062?v=3","gravatar_id":"","url":"https://api.github.com/users/martin-spinks","html_url":"https://github.com/martin-spinks","followers_url":"https://api.github.com/users/martin-spinks/followers","following_url":"https://api.github.com/users/martin-spinks/following{/other_user}","gists_url":"https://api.github.com/users/martin-spinks/gists{/gist_id}","starred_url":"https://api.github.com/users/martin-spinks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martin-spinks/subscriptions","organizations_url":"https://api.github.com/users/martin-spinks/orgs","repos_url":"https://api.github.com/users/martin-spinks/repos","events_url":"https://api.github.com/users/martin-spinks/events{/privacy}","received_events_url":"https://api.github.com/users/martin-spinks/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-08T08:22:36Z","updated_at":"2016-06-08T13:10:27Z","closed_at":null,"body":"Firstly thanks so much for the mixin, having installed the mixin and played with it a little on a test env, what the is the proposed approach you recommend for creating root nodes (nodes that have no parent)?\r\n\r\nAt the moment; the addNode endpoint requires that a parent is specified; which makes sense if you're adding a node it needs to be attached to something; should there be an addRoot endpoint perhaps to allow nodes to be created with a parent of null?  \r\n\r\nHow do you implement a root node at the moment if you're using the mixin, are you assuming that there is already an item in the DB (I'm using mongo also) with a parent of null?\r\n\r\nMore than happy to make a pull request so add this if you'd like?      "},"comment":{"url":"https://api.github.com/repos/mbouclas/loopback-ds-tree-mixin/issues/comments/224583579","html_url":"https://github.com/mbouclas/loopback-ds-tree-mixin/issues/1#issuecomment-224583579","issue_url":"https://api.github.com/repos/mbouclas/loopback-ds-tree-mixin/issues/1","id":224583579,"user":{"login":"mbouclas","id":642742,"avatar_url":"https://avatars.githubusercontent.com/u/642742?v=3","gravatar_id":"","url":"https://api.github.com/users/mbouclas","html_url":"https://github.com/mbouclas","followers_url":"https://api.github.com/users/mbouclas/followers","following_url":"https://api.github.com/users/mbouclas/following{/other_user}","gists_url":"https://api.github.com/users/mbouclas/gists{/gist_id}","starred_url":"https://api.github.com/users/mbouclas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbouclas/subscriptions","organizations_url":"https://api.github.com/users/mbouclas/orgs","repos_url":"https://api.github.com/users/mbouclas/repos","events_url":"https://api.github.com/users/mbouclas/events{/privacy}","received_events_url":"https://api.github.com/users/mbouclas/received_events","type":"User","site_admin":false},"created_at":"2016-06-08T13:10:27Z","updated_at":"2016-06-08T13:10:27Z","body":"As far as root nodes are concerned, what i do now is just create a simple model and save it. As this is a root node, no need for any special handling. You could also pass an empty object and it will figure out that you are refering to a root node.\r\n\r\nI know that i should probably have added a \"addRoot()\" method, but it is kind of useless in some ways."}}
{"actor":{"display_login":"mbouclas"}}