{"action":"created","comment":{"url":"https://api.github.com/repos/andela/suyabay/pulls/comments/61134847","id":61134847,"diff_hunk":"@@ -1,6 +1,95 @@\n-var  clipboard = new Clipboard(\".copy\");\n+\tvar copy = document.getElementById('copy');\n+\tvar  clipboard = new Clipboard(copy);\n \n-clipboard.on(\"success\", function() {\n-    swal(\"Token copied successfully\");\n-});\n+\tclipboard.on(\"success\", function() {\n+    \tswal(\"Token copied successfully\");\n+\t});\n \n+\n+\t$('#delete-api').click(function() {\n+\t\tvar id      = $(this).data(\"id\");\n+        var url     = \"/developer/myapp/\"+id+\"/delete\";\n+        var data    =  {\n+            parameter: {\n+                _token       : $(this).data(\"token\")\n+            }\n+        }\n+        confirmApiDelete(url);\n+\n+        return false;\n+    });\n+\n+/**\n+ *process the ajax call\n+ *\n+ * @param  url\n+ * @param  parameter\n+ */\n+function processAjaxApiCall (url, parameter)\n+{\n+    $.ajax({\n+        url: url,\n+        type: 'GET',\n+        data: parameter,\n+        success: function(response) {\n+            if (response == 200) {\n+            \tapiSuccessMessage();\n+            } else {\n+            \tswal({\n+            \t\ttitle: \"Cancelled\", \n+            \t\ttext:   \"Your app is retained\",\n+    \t\t\t\tconfirmButtonColor: \"#26a69a\",\n+    \t\t\t\ttype: \"error\"\n+    \t\t\t});\n+            }\n+        }\n+    });\n+}\n+\n+/**\n+ *confirmDelete modal message\n+ *\n+ * @param  url\n+ */\n+function confirmApiDelete (url)\n+{\n+    swal({   \n+    \ttitle: \"Are you sure?\",   \n+    \ttext: \"You will not be able to recover this app!\",   \n+    \ttype: \"warning\",   \n+    \tshowCancelButton: true,   \n+    \tconfirmButtonColor: \"#26a69a\",   \n+    \tconfirmButtonText: \"Yes, delete it!\",   ","path":"public/js/api.js","position":66,"original_position":66,"commit_id":"8d9aa7a684c22f819c2a6f881a9935a0d36c6285","original_commit_id":"8d9aa7a684c22f819c2a6f881a9935a0d36c6285","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Mixed double and single quotes.","created_at":"2016-04-26T18:04:18Z","updated_at":"2016-04-26T18:04:18Z","html_url":"https://github.com/andela/suyabay/pull/271#discussion_r61134847","pull_request_url":"https://api.github.com/repos/andela/suyabay/pulls/271","_links":{"self":{"href":"https://api.github.com/repos/andela/suyabay/pulls/comments/61134847"},"html":{"href":"https://github.com/andela/suyabay/pull/271#discussion_r61134847"},"pull_request":{"href":"https://api.github.com/repos/andela/suyabay/pulls/271"}}},"pull_request":{"url":"https://api.github.com/repos/andela/suyabay/pulls/271","id":67931162,"html_url":"https://github.com/andela/suyabay/pull/271","diff_url":"https://github.com/andela/suyabay/pull/271.diff","patch_url":"https://github.com/andela/suyabay/pull/271.patch","issue_url":"https://api.github.com/repos/andela/suyabay/issues/271","number":271,"state":"open","locked":false,"title":"#118376691 Developers should be able to delete their apps","user":{"login":"andela-araimi","id":14159420,"avatar_url":"https://avatars.githubusercontent.com/u/14159420?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-araimi","html_url":"https://github.com/andela-araimi","followers_url":"https://api.github.com/users/andela-araimi/followers","following_url":"https://api.github.com/users/andela-araimi/following{/other_user}","gists_url":"https://api.github.com/users/andela-araimi/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-araimi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-araimi/subscriptions","organizations_url":"https://api.github.com/users/andela-araimi/orgs","repos_url":"https://api.github.com/users/andela-araimi/repos","events_url":"https://api.github.com/users/andela-araimi/events{/privacy}","received_events_url":"https://api.github.com/users/andela-araimi/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\n\r\n- Give developers the privilege to delete their apps.\r\n- Fix the issue raised by @unicodeveloper. Issue: `#269` and `#270`.\r\n\r\n#### Description of Task to be completed?\r\n\r\nDevelopers are given the privilege to delete their apps. It is implemented in such a way that if a developer mistakenly clicks on the `delete button`, a pop-up will display to confirm the action. The developer can then choose whether to proceed with the action or not.\r\n\r\n#### How should this be manually tested?\r\n\r\nFrom the `My app` page, which displays all the apps the developers have on suyabay. Each title of the apps is linked to another page which displays the full details of the app. In this page, a  `delete button` is located below the app details. Click on this `delete button` which displays the pop-up. This confirms whether to delete the app or not. If the developer is willing to delete the app, click on the `Yes, Delete this app` button. This action deletes the app and redirects the developer to the `My app`page.\r\n\r\n#### Any background context you want to provide?\r\nNone\r\n#### What are the relevant pivotal tracker stories?\r\n#118376691\r\n#### Screenshots (if appropriate)\r\n![screen shot 2016-04-26 at 6 46 25 pm](https://cloud.githubusercontent.com/assets/14159420/14828551/56fcc9ba-0bdf-11e6-848b-c649c98150d4.png)\r\n![screen shot 2016-04-26 at 6 46 31 pm](https://cloud.githubusercontent.com/assets/14159420/14828553/5701e79c-0bdf-11e6-8ab5-b396a0232184.png)\r\n![screen shot 2016-04-26 at 6 46 37 pm](https://cloud.githubusercontent.com/assets/14159420/14828552/5701d4c8-0bdf-11e6-9e34-686f0e037f91.png)\r\n\r\n\r\n#### Questions:\r\n[@unicodeveloper](https://github.com/unicodeveloper)\r\n[@andela-oadebayo](https://github.com/andela-oadebayo)","created_at":"2016-04-26T18:03:56Z","updated_at":"2016-04-26T18:04:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"64c53bb1f878b756152a8404e54827f6630f83aa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/andela/suyabay/pulls/271/commits","review_comments_url":"https://api.github.com/repos/andela/suyabay/pulls/271/comments","review_comment_url":"https://api.github.com/repos/andela/suyabay/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/suyabay/issues/271/comments","statuses_url":"https://api.github.com/repos/andela/suyabay/statuses/8d9aa7a684c22f819c2a6f881a9935a0d36c6285","head":{"label":"andela:ft-developers-should-be-able-to-delete-their-apps-#118376691","ref":"ft-developers-should-be-able-to-delete-their-apps-#118376691","sha":"8d9aa7a684c22f819c2a6f881a9935a0d36c6285","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":41855319,"name":"suyabay","full_name":"andela/suyabay","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/suyabay","description":"Awesome Podcast FM Network for Suya Lovers","fork":false,"url":"https://api.github.com/repos/andela/suyabay","forks_url":"https://api.github.com/repos/andela/suyabay/forks","keys_url":"https://api.github.com/repos/andela/suyabay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/suyabay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/suyabay/teams","hooks_url":"https://api.github.com/repos/andela/suyabay/hooks","issue_events_url":"https://api.github.com/repos/andela/suyabay/issues/events{/number}","events_url":"https://api.github.com/repos/andela/suyabay/events","assignees_url":"https://api.github.com/repos/andela/suyabay/assignees{/user}","branches_url":"https://api.github.com/repos/andela/suyabay/branches{/branch}","tags_url":"https://api.github.com/repos/andela/suyabay/tags","blobs_url":"https://api.github.com/repos/andela/suyabay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/suyabay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/suyabay/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/suyabay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/suyabay/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/suyabay/languages","stargazers_url":"https://api.github.com/repos/andela/suyabay/stargazers","contributors_url":"https://api.github.com/repos/andela/suyabay/contributors","subscribers_url":"https://api.github.com/repos/andela/suyabay/subscribers","subscription_url":"https://api.github.com/repos/andela/suyabay/subscription","commits_url":"https://api.github.com/repos/andela/suyabay/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/suyabay/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/suyabay/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/suyabay/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/suyabay/contents/{+path}","compare_url":"https://api.github.com/repos/andela/suyabay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/suyabay/merges","archive_url":"https://api.github.com/repos/andela/suyabay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/suyabay/downloads","issues_url":"https://api.github.com/repos/andela/suyabay/issues{/number}","pulls_url":"https://api.github.com/repos/andela/suyabay/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/suyabay/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/suyabay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/suyabay/labels{/name}","releases_url":"https://api.github.com/repos/andela/suyabay/releases{/id}","deployments_url":"https://api.github.com/repos/andela/suyabay/deployments","created_at":"2015-09-03T11:00:56Z","updated_at":"2016-03-11T18:32:31Z","pushed_at":"2016-04-26T18:03:56Z","git_url":"git://github.com/andela/suyabay.git","ssh_url":"git@github.com:andela/suyabay.git","clone_url":"https://github.com/andela/suyabay.git","svn_url":"https://github.com/andela/suyabay","homepage":"https://suyabay-staging.herokuapp.com","size":35736,"stargazers_count":8,"watchers_count":8,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":9,"forks":4,"open_issues":9,"watchers":8,"default_branch":"staging"}},"base":{"label":"andela:staging","ref":"staging","sha":"a6bddfd87447d2904df18f6fe769e6c75fd5108a","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":41855319,"name":"suyabay","full_name":"andela/suyabay","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/suyabay","description":"Awesome Podcast FM Network for Suya Lovers","fork":false,"url":"https://api.github.com/repos/andela/suyabay","forks_url":"https://api.github.com/repos/andela/suyabay/forks","keys_url":"https://api.github.com/repos/andela/suyabay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/suyabay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/suyabay/teams","hooks_url":"https://api.github.com/repos/andela/suyabay/hooks","issue_events_url":"https://api.github.com/repos/andela/suyabay/issues/events{/number}","events_url":"https://api.github.com/repos/andela/suyabay/events","assignees_url":"https://api.github.com/repos/andela/suyabay/assignees{/user}","branches_url":"https://api.github.com/repos/andela/suyabay/branches{/branch}","tags_url":"https://api.github.com/repos/andela/suyabay/tags","blobs_url":"https://api.github.com/repos/andela/suyabay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/suyabay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/suyabay/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/suyabay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/suyabay/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/suyabay/languages","stargazers_url":"https://api.github.com/repos/andela/suyabay/stargazers","contributors_url":"https://api.github.com/repos/andela/suyabay/contributors","subscribers_url":"https://api.github.com/repos/andela/suyabay/subscribers","subscription_url":"https://api.github.com/repos/andela/suyabay/subscription","commits_url":"https://api.github.com/repos/andela/suyabay/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/suyabay/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/suyabay/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/suyabay/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/suyabay/contents/{+path}","compare_url":"https://api.github.com/repos/andela/suyabay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/suyabay/merges","archive_url":"https://api.github.com/repos/andela/suyabay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/suyabay/downloads","issues_url":"https://api.github.com/repos/andela/suyabay/issues{/number}","pulls_url":"https://api.github.com/repos/andela/suyabay/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/suyabay/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/suyabay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/suyabay/labels{/name}","releases_url":"https://api.github.com/repos/andela/suyabay/releases{/id}","deployments_url":"https://api.github.com/repos/andela/suyabay/deployments","created_at":"2015-09-03T11:00:56Z","updated_at":"2016-03-11T18:32:31Z","pushed_at":"2016-04-26T18:03:56Z","git_url":"git://github.com/andela/suyabay.git","ssh_url":"git@github.com:andela/suyabay.git","clone_url":"https://github.com/andela/suyabay.git","svn_url":"https://github.com/andela/suyabay","homepage":"https://suyabay-staging.herokuapp.com","size":35736,"stargazers_count":8,"watchers_count":8,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":9,"forks":4,"open_issues":9,"watchers":8,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/suyabay/pulls/271"},"html":{"href":"https://github.com/andela/suyabay/pull/271"},"issue":{"href":"https://api.github.com/repos/andela/suyabay/issues/271"},"comments":{"href":"https://api.github.com/repos/andela/suyabay/issues/271/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/suyabay/pulls/271/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/suyabay/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/suyabay/pulls/271/commits"},"statuses":{"href":"https://api.github.com/repos/andela/suyabay/statuses/8d9aa7a684c22f819c2a6f881a9935a0d36c6285"}}}}