{"action":"created","issue":{"url":"https://api.github.com/repos/sakuraapi/core/issues/141","repository_url":"https://api.github.com/repos/sakuraapi/core","labels_url":"https://api.github.com/repos/sakuraapi/core/issues/141/labels{/name}","comments_url":"https://api.github.com/repos/sakuraapi/core/issues/141/comments","events_url":"https://api.github.com/repos/sakuraapi/core/issues/141/events","html_url":"https://github.com/sakuraapi/core/issues/141","id":299298903,"number":141,"title":"Getting error while running test on model endpoint with default configuration generated by CLI","user":{"login":"vasuvanka","id":9362840,"avatar_url":"https://avatars3.githubusercontent.com/u/9362840?v=4","gravatar_id":"","url":"https://api.github.com/users/vasuvanka","html_url":"https://github.com/vasuvanka","followers_url":"https://api.github.com/users/vasuvanka/followers","following_url":"https://api.github.com/users/vasuvanka/following{/other_user}","gists_url":"https://api.github.com/users/vasuvanka/gists{/gist_id}","starred_url":"https://api.github.com/users/vasuvanka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vasuvanka/subscriptions","organizations_url":"https://api.github.com/users/vasuvanka/orgs","repos_url":"https://api.github.com/users/vasuvanka/repos","events_url":"https://api.github.com/users/vasuvanka/events{/privacy}","received_events_url":"https://api.github.com/users/vasuvanka/received_events","type":"User","site_admin":false},"labels":[{"id":488829455,"url":"https://api.github.com/repos/sakuraapi/core/labels/bug","name":"bug","color":"ee0701","default":true},{"id":845785495,"url":"https://api.github.com/repos/sakuraapi/core/labels/hotfix","name":"hotfix","color":"ee0701","default":false},{"id":501212838,"url":"https://api.github.com/repos/sakuraapi/core/labels/in%20progress","name":"in progress","color":"72DD58","default":false}],"state":"open","locked":false,"assignee":{"login":"etsuo","id":6020168,"avatar_url":"https://avatars2.githubusercontent.com/u/6020168?v=4","gravatar_id":"","url":"https://api.github.com/users/etsuo","html_url":"https://github.com/etsuo","followers_url":"https://api.github.com/users/etsuo/followers","following_url":"https://api.github.com/users/etsuo/following{/other_user}","gists_url":"https://api.github.com/users/etsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/etsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etsuo/subscriptions","organizations_url":"https://api.github.com/users/etsuo/orgs","repos_url":"https://api.github.com/users/etsuo/repos","events_url":"https://api.github.com/users/etsuo/events{/privacy}","received_events_url":"https://api.github.com/users/etsuo/received_events","type":"User","site_admin":false},"assignees":[{"login":"etsuo","id":6020168,"avatar_url":"https://avatars2.githubusercontent.com/u/6020168?v=4","gravatar_id":"","url":"https://api.github.com/users/etsuo","html_url":"https://github.com/etsuo","followers_url":"https://api.github.com/users/etsuo/followers","following_url":"https://api.github.com/users/etsuo/following{/other_user}","gists_url":"https://api.github.com/users/etsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/etsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etsuo/subscriptions","organizations_url":"https://api.github.com/users/etsuo/orgs","repos_url":"https://api.github.com/users/etsuo/repos","events_url":"https://api.github.com/users/etsuo/events{/privacy}","received_events_url":"https://api.github.com/users/etsuo/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/sakuraapi/core/milestones/19","html_url":"https://github.com/sakuraapi/core/milestone/19","labels_url":"https://api.github.com/repos/sakuraapi/core/milestones/19/labels","id":3138257,"number":19,"title":"0.10.1","description":null,"creator":{"login":"etsuo","id":6020168,"avatar_url":"https://avatars2.githubusercontent.com/u/6020168?v=4","gravatar_id":"","url":"https://api.github.com/users/etsuo","html_url":"https://github.com/etsuo","followers_url":"https://api.github.com/users/etsuo/followers","following_url":"https://api.github.com/users/etsuo/following{/other_user}","gists_url":"https://api.github.com/users/etsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/etsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etsuo/subscriptions","organizations_url":"https://api.github.com/users/etsuo/orgs","repos_url":"https://api.github.com/users/etsuo/repos","events_url":"https://api.github.com/users/etsuo/events{/privacy}","received_events_url":"https://api.github.com/users/etsuo/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2018-02-23T05:32:24Z","updated_at":"2018-02-23T05:32:24Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2018-02-22T10:29:31Z","updated_at":"2018-02-23T06:27:16Z","closed_at":null,"author_association":"NONE","body":"While running test on the model endpoint.\r\n\r\n``` \r\n\r\n{ message: ’getDb for model \\‘UserModel\\’ failed because database name \\‘user\\’ was not defined. Make sure your @Model({dbConfig.db}) is set to a valid database name from your environment config\\‘s dbConnections:[{name:\\‘...\\’}] setting. Also, make sure you\\‘ve started SakuraApi, or that you have manually started db connections (e.g. with SakuraMongoDbConnection.connectAll())’ }\r\n\r\n```\r\n\r\ngot this error.route model not able to find the database name.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sakuraapi/core/issues/comments/367922066","html_url":"https://github.com/sakuraapi/core/issues/141#issuecomment-367922066","issue_url":"https://api.github.com/repos/sakuraapi/core/issues/141","id":367922066,"user":{"login":"etsuo","id":6020168,"avatar_url":"https://avatars2.githubusercontent.com/u/6020168?v=4","gravatar_id":"","url":"https://api.github.com/users/etsuo","html_url":"https://github.com/etsuo","followers_url":"https://api.github.com/users/etsuo/followers","following_url":"https://api.github.com/users/etsuo/following{/other_user}","gists_url":"https://api.github.com/users/etsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/etsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etsuo/subscriptions","organizations_url":"https://api.github.com/users/etsuo/orgs","repos_url":"https://api.github.com/users/etsuo/repos","events_url":"https://api.github.com/users/etsuo/events{/privacy}","received_events_url":"https://api.github.com/users/etsuo/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T06:27:16Z","updated_at":"2018-02-23T06:27:16Z","author_association":"OWNER","body":"@vasuvanka help me understand how that's different than what I posted in the comment prior? I want to make sure I'm not missing anything. You actually don't need to call `sapi.dbConnections.connectAll()` before calling `sapi.listen` -- `listen` will initialize the db connections if it determines that has not yet been done. You can manually tell SakuraApi to connect to the db before listening if you need to do some db work before starting the web server. \r\n\r\nUnless there's something different with what I listed [here](https://github.com/sakuraapi/core/issues/141#issuecomment-367913633), then I believe your problem is that your configuration isn't right. Double check using the example I gave above.\r\n\r\nHowever, there is still the other error I ran into even with the example above (the `TypeError: Cannot read property 'constructor' of undefined` error). I committed some tests on the `hotfix/141` branch to try to cause the same kind of error in the tests for `getAllRouteHandler`, but it seems to be working fine in those test.\r\n\r\nOne thing I noticed is that this feature (the auto-creation of CRUD endpoints if you define a model on a  routable) has very little testing in the core code.\r\n\r\nLet me know if you double checked all your configuration and if you're still getting the DB error. Once you get past the DB error, please also let me know if you are also getting the constructor error.\r\n\r\nThanks."}}
{"actor":{"display_login":"etsuo"}}