{"action":"created","comment":{"url":"https://api.github.com/repos/marmelab/ng-admin/pulls/comments/39142723","id":39142723,"diff_hunk":"@@ -22,21 +23,29 @@ define(function () {\n \n     DeleteController.prototype.deleteOne = function () {\n         var notification = this.notification,\n-            entityName = this.entity.name(),\n-            $window = this.$window;\n-\n-        this.WriteQueries.deleteOne(this.view, this.entityId).then(function () {\n-            this.back();\n-            notification.log('Element successfully deleted.', { addnCls: 'humane-flatty-success' });\n-        }.bind(this), function (response) {\n-            // @TODO: share this method when splitting controllers\n-            var body = response.data;\n-            if (typeof body === 'object') {\n-                body = JSON.stringify(body);\n-            }\n-\n-            notification.log('Oops, an error occured : (code: ' + response.status + ') ' + body, {addnCls: 'humane-flatty-error'});\n-        });\n+            entityName = this.entity.name();\n+\n+        return this.WriteQueries.deleteOne(this.view, this.entityId)\n+            .then(\n+                function () {\n+                    this.$state.go(this.$state.get('list'), angular.extend({\n+                        entity: entityName\n+                    }, this.$state.params));\n+\n+                    notification.log('Element successfully deleted.', { addnCls: 'humane-flatty-success' });\n+                }.bind(this),\n+                function (response) {\n+                    // @TODO: share this method when splitting controllers\n+                    var body = response.data;\n+                    if (typeof body === 'object') {\n+                        body = JSON.stringify(body);\n+                    }\n+\n+                    this.back();","path":"src/javascripts/ng-admin/Crud/delete/DeleteController.js","position":68,"original_position":49,"commit_id":"d83ab1a91682be38b5f5a31d0cfdce46ffe9f52e","original_commit_id":"f06fc65c16cfe41639161de345e6a4a8043af63f","user":{"login":"jpetitcolas","id":688373,"avatar_url":"https://avatars.githubusercontent.com/u/688373?v=3","gravatar_id":"","url":"https://api.github.com/users/jpetitcolas","html_url":"https://github.com/jpetitcolas","followers_url":"https://api.github.com/users/jpetitcolas/followers","following_url":"https://api.github.com/users/jpetitcolas/following{/other_user}","gists_url":"https://api.github.com/users/jpetitcolas/gists{/gist_id}","starred_url":"https://api.github.com/users/jpetitcolas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpetitcolas/subscriptions","organizations_url":"https://api.github.com/users/jpetitcolas/orgs","repos_url":"https://api.github.com/users/jpetitcolas/repos","events_url":"https://api.github.com/users/jpetitcolas/events{/privacy}","received_events_url":"https://api.github.com/users/jpetitcolas/received_events","type":"User","site_admin":false},"body":"To remove","created_at":"2015-09-10T09:55:22Z","updated_at":"2015-09-10T09:55:22Z","html_url":"https://github.com/marmelab/ng-admin/pull/642#discussion_r39142723","pull_request_url":"https://api.github.com/repos/marmelab/ng-admin/pulls/642","_links":{"self":{"href":"https://api.github.com/repos/marmelab/ng-admin/pulls/comments/39142723"},"html":{"href":"https://github.com/marmelab/ng-admin/pull/642#discussion_r39142723"},"pull_request":{"href":"https://api.github.com/repos/marmelab/ng-admin/pulls/642"}}},"pull_request":{"url":"https://api.github.com/repos/marmelab/ng-admin/pulls/642","id":43873172,"html_url":"https://github.com/marmelab/ng-admin/pull/642","diff_url":"https://github.com/marmelab/ng-admin/pull/642.diff","patch_url":"https://github.com/marmelab/ng-admin/pull/642.patch","issue_url":"https://api.github.com/repos/marmelab/ng-admin/issues/642","number":642,"state":"open","locked":false,"title":"[WIP] Return to list view when deleting a record","user":{"login":"jpetitcolas","id":688373,"avatar_url":"https://avatars.githubusercontent.com/u/688373?v=3","gravatar_id":"","url":"https://api.github.com/users/jpetitcolas","html_url":"https://github.com/jpetitcolas","followers_url":"https://api.github.com/users/jpetitcolas/followers","following_url":"https://api.github.com/users/jpetitcolas/following{/other_user}","gists_url":"https://api.github.com/users/jpetitcolas/gists{/gist_id}","starred_url":"https://api.github.com/users/jpetitcolas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpetitcolas/subscriptions","organizations_url":"https://api.github.com/users/jpetitcolas/orgs","repos_url":"https://api.github.com/users/jpetitcolas/repos","events_url":"https://api.github.com/users/jpetitcolas/events{/privacy}","received_events_url":"https://api.github.com/users/jpetitcolas/received_events","type":"User","site_admin":false},"body":"Needs to implement and fix tests.\r\n\r\nCloses #641.","created_at":"2015-09-01T13:09:38Z","updated_at":"2015-09-10T09:55:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c5e0bf3bf2d3a21db2adf552855a21f0bf9ac8c0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/marmelab/ng-admin/pulls/642/commits","review_comments_url":"https://api.github.com/repos/marmelab/ng-admin/pulls/642/comments","review_comment_url":"https://api.github.com/repos/marmelab/ng-admin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marmelab/ng-admin/issues/642/comments","statuses_url":"https://api.github.com/repos/marmelab/ng-admin/statuses/d83ab1a91682be38b5f5a31d0cfdce46ffe9f52e","head":{"label":"marmelab:show_list_redirect","ref":"show_list_redirect","sha":"d83ab1a91682be38b5f5a31d0cfdce46ffe9f52e","user":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars.githubusercontent.com/u/3116319?v=3","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"repo":{"id":20059361,"name":"ng-admin","full_name":"marmelab/ng-admin","owner":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars.githubusercontent.com/u/3116319?v=3","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marmelab/ng-admin","description":"Add an AngularJS admin GUI to any RESTful API","fork":false,"url":"https://api.github.com/repos/marmelab/ng-admin","forks_url":"https://api.github.com/repos/marmelab/ng-admin/forks","keys_url":"https://api.github.com/repos/marmelab/ng-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marmelab/ng-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marmelab/ng-admin/teams","hooks_url":"https://api.github.com/repos/marmelab/ng-admin/hooks","issue_events_url":"https://api.github.com/repos/marmelab/ng-admin/issues/events{/number}","events_url":"https://api.github.com/repos/marmelab/ng-admin/events","assignees_url":"https://api.github.com/repos/marmelab/ng-admin/assignees{/user}","branches_url":"https://api.github.com/repos/marmelab/ng-admin/branches{/branch}","tags_url":"https://api.github.com/repos/marmelab/ng-admin/tags","blobs_url":"https://api.github.com/repos/marmelab/ng-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marmelab/ng-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marmelab/ng-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/marmelab/ng-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marmelab/ng-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/marmelab/ng-admin/languages","stargazers_url":"https://api.github.com/repos/marmelab/ng-admin/stargazers","contributors_url":"https://api.github.com/repos/marmelab/ng-admin/contributors","subscribers_url":"https://api.github.com/repos/marmelab/ng-admin/subscribers","subscription_url":"https://api.github.com/repos/marmelab/ng-admin/subscription","commits_url":"https://api.github.com/repos/marmelab/ng-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/marmelab/ng-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/marmelab/ng-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/marmelab/ng-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/marmelab/ng-admin/contents/{+path}","compare_url":"https://api.github.com/repos/marmelab/ng-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marmelab/ng-admin/merges","archive_url":"https://api.github.com/repos/marmelab/ng-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marmelab/ng-admin/downloads","issues_url":"https://api.github.com/repos/marmelab/ng-admin/issues{/number}","pulls_url":"https://api.github.com/repos/marmelab/ng-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/marmelab/ng-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/marmelab/ng-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marmelab/ng-admin/labels{/name}","releases_url":"https://api.github.com/repos/marmelab/ng-admin/releases{/id}","created_at":"2014-05-22T12:00:10Z","updated_at":"2015-09-10T03:07:15Z","pushed_at":"2015-09-10T09:53:34Z","git_url":"git://github.com/marmelab/ng-admin.git","ssh_url":"git@github.com:marmelab/ng-admin.git","clone_url":"https://github.com/marmelab/ng-admin.git","svn_url":"https://github.com/marmelab/ng-admin","homepage":"http://marmelab.com/ng-admin-demo/","size":64090,"stargazers_count":1966,"watchers_count":1966,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":201,"mirror_url":null,"open_issues_count":45,"forks":201,"open_issues":45,"watchers":1966,"default_branch":"master"}},"base":{"label":"marmelab:master","ref":"master","sha":"8d7b72a15be662d1ac2e2f0486116d1615151cff","user":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars.githubusercontent.com/u/3116319?v=3","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"repo":{"id":20059361,"name":"ng-admin","full_name":"marmelab/ng-admin","owner":{"login":"marmelab","id":3116319,"avatar_url":"https://avatars.githubusercontent.com/u/3116319?v=3","gravatar_id":"","url":"https://api.github.com/users/marmelab","html_url":"https://github.com/marmelab","followers_url":"https://api.github.com/users/marmelab/followers","following_url":"https://api.github.com/users/marmelab/following{/other_user}","gists_url":"https://api.github.com/users/marmelab/gists{/gist_id}","starred_url":"https://api.github.com/users/marmelab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marmelab/subscriptions","organizations_url":"https://api.github.com/users/marmelab/orgs","repos_url":"https://api.github.com/users/marmelab/repos","events_url":"https://api.github.com/users/marmelab/events{/privacy}","received_events_url":"https://api.github.com/users/marmelab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/marmelab/ng-admin","description":"Add an AngularJS admin GUI to any RESTful API","fork":false,"url":"https://api.github.com/repos/marmelab/ng-admin","forks_url":"https://api.github.com/repos/marmelab/ng-admin/forks","keys_url":"https://api.github.com/repos/marmelab/ng-admin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marmelab/ng-admin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marmelab/ng-admin/teams","hooks_url":"https://api.github.com/repos/marmelab/ng-admin/hooks","issue_events_url":"https://api.github.com/repos/marmelab/ng-admin/issues/events{/number}","events_url":"https://api.github.com/repos/marmelab/ng-admin/events","assignees_url":"https://api.github.com/repos/marmelab/ng-admin/assignees{/user}","branches_url":"https://api.github.com/repos/marmelab/ng-admin/branches{/branch}","tags_url":"https://api.github.com/repos/marmelab/ng-admin/tags","blobs_url":"https://api.github.com/repos/marmelab/ng-admin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marmelab/ng-admin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marmelab/ng-admin/git/refs{/sha}","trees_url":"https://api.github.com/repos/marmelab/ng-admin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marmelab/ng-admin/statuses/{sha}","languages_url":"https://api.github.com/repos/marmelab/ng-admin/languages","stargazers_url":"https://api.github.com/repos/marmelab/ng-admin/stargazers","contributors_url":"https://api.github.com/repos/marmelab/ng-admin/contributors","subscribers_url":"https://api.github.com/repos/marmelab/ng-admin/subscribers","subscription_url":"https://api.github.com/repos/marmelab/ng-admin/subscription","commits_url":"https://api.github.com/repos/marmelab/ng-admin/commits{/sha}","git_commits_url":"https://api.github.com/repos/marmelab/ng-admin/git/commits{/sha}","comments_url":"https://api.github.com/repos/marmelab/ng-admin/comments{/number}","issue_comment_url":"https://api.github.com/repos/marmelab/ng-admin/issues/comments{/number}","contents_url":"https://api.github.com/repos/marmelab/ng-admin/contents/{+path}","compare_url":"https://api.github.com/repos/marmelab/ng-admin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marmelab/ng-admin/merges","archive_url":"https://api.github.com/repos/marmelab/ng-admin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marmelab/ng-admin/downloads","issues_url":"https://api.github.com/repos/marmelab/ng-admin/issues{/number}","pulls_url":"https://api.github.com/repos/marmelab/ng-admin/pulls{/number}","milestones_url":"https://api.github.com/repos/marmelab/ng-admin/milestones{/number}","notifications_url":"https://api.github.com/repos/marmelab/ng-admin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marmelab/ng-admin/labels{/name}","releases_url":"https://api.github.com/repos/marmelab/ng-admin/releases{/id}","created_at":"2014-05-22T12:00:10Z","updated_at":"2015-09-10T03:07:15Z","pushed_at":"2015-09-10T09:53:34Z","git_url":"git://github.com/marmelab/ng-admin.git","ssh_url":"git@github.com:marmelab/ng-admin.git","clone_url":"https://github.com/marmelab/ng-admin.git","svn_url":"https://github.com/marmelab/ng-admin","homepage":"http://marmelab.com/ng-admin-demo/","size":64090,"stargazers_count":1966,"watchers_count":1966,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":201,"mirror_url":null,"open_issues_count":45,"forks":201,"open_issues":45,"watchers":1966,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marmelab/ng-admin/pulls/642"},"html":{"href":"https://github.com/marmelab/ng-admin/pull/642"},"issue":{"href":"https://api.github.com/repos/marmelab/ng-admin/issues/642"},"comments":{"href":"https://api.github.com/repos/marmelab/ng-admin/issues/642/comments"},"review_comments":{"href":"https://api.github.com/repos/marmelab/ng-admin/pulls/642/comments"},"review_comment":{"href":"https://api.github.com/repos/marmelab/ng-admin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marmelab/ng-admin/pulls/642/commits"},"statuses":{"href":"https://api.github.com/repos/marmelab/ng-admin/statuses/d83ab1a91682be38b5f5a31d0cfdce46ffe9f52e"}}}}