{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/447","repository_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project","labels_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/447/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/447/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/447/events","html_url":"https://github.com/ga-wdi-boston/full-stack-project/issues/447","id":181031800,"number":447,"title":"Can pass specific ID when trying to delete an event","user":{"login":"rosmith76","id":20599957,"avatar_url":"https://avatars.githubusercontent.com/u/20599957?v=3","gravatar_id":"","url":"https://api.github.com/users/rosmith76","html_url":"https://github.com/rosmith76","followers_url":"https://api.github.com/users/rosmith76/followers","following_url":"https://api.github.com/users/rosmith76/following{/other_user}","gists_url":"https://api.github.com/users/rosmith76/gists{/gist_id}","starred_url":"https://api.github.com/users/rosmith76/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosmith76/subscriptions","organizations_url":"https://api.github.com/users/rosmith76/orgs","repos_url":"https://api.github.com/users/rosmith76/repos","events_url":"https://api.github.com/users/rosmith76/events{/privacy}","received_events_url":"https://api.github.com/users/rosmith76/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-10-04T23:37:53Z","updated_at":"2016-10-08T19:11:34Z","closed_at":null,"body":"Curl request works.\r\n\r\nconsole log error\r\n```.html\r\njquery.js:9175 OPTIONS http://localhost:3000/events/[object%20Object] send @ jquery.js:9175ajax @ jquery.js:8656deleteEvent @ api.js:44onDeleteEvent @ events.js:45dispatch @ jquery.js:4737elemData.handle @ jquery.js:4549\r\n2016-10-04 19:35:17.220 localhost/:1 XMLHttpRequest cannot load http://localhost:3000/events/[object%20Object]. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 400.\r\n2016-10-04 19:35:17.220 jquery.js:9175 XHR failed loading: DELETE \"http://localhost:3000/events/[object%20Object]\".send @ jquery.js:9175ajax @ jquery.js:8656deleteEvent @ api.js:44onDeleteEvent @ events.js:45dispatch @ jquery.js:4737elemData.handle @ jquery.js:4549\r\n2016-10-04 19:35:17.221 ui.js:13 Object {readyState: 0, status: 0, statusText: \"error\"}\r\n```\r\nI know this link \"http://localhost:3000/events/\". needs an ID to work. I can't figure that part out. \r\n\r\nHTML\r\n```.html\r\n   <div class=\"modal fade\" id=\"delete-events-button\" tabindex=\"-1\"role=\"dialog\" aria-labelledby=\"deleteEventsModalLabel\">\r\n    <div class=\"modal-dialog\" role=\"document\">\r\n      <div class=\"modal-content\">\r\n        <form id=\"delete-event\">\r\n          <fieldset>\r\n            <legend>Delete Show</legend>\r\n            <input type= \"text\" name= \"event_id\" placeholder=\"Event ID#\">\r\n            <input type=\"submit\" name=\"submit\" value=\"Delete\">\r\n          </fieldset>\r\n        </form>\r\n        <div class=\"modal-header\">\r\n          <button type=\"button\" class=\"close\" data-dismiss=\"modal\"\r\n            aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n```\r\nUI\r\n```.js\r\nconst deleteEventSuccess = (data) => {\r\n  console.log (data);\r\n};\r\n```\r\nAPI\r\n```.js\r\nconst deleteEvent = (data) => {\r\n  return $.ajax({\r\n    url: app.host + '/events/' + data,\r\n    method: 'DELETE',\r\n    headers: {\r\n      Authorization: 'Token token=' + app.user.token,\r\n    },\r\n  });\r\n};\r\n```\r\nevents\r\n```.js\r\nconst onDeleteEvent =(data) => {\r\n  event.preventDefault();\r\n  api.deleteEvent(data)\r\n    .done(ui.deleteEventSuccess)\r\n    .fail(ui.failure);\r\n};\r\n```"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/comments/252442608","html_url":"https://github.com/ga-wdi-boston/full-stack-project/issues/447#issuecomment-252442608","issue_url":"https://api.github.com/repos/ga-wdi-boston/full-stack-project/issues/447","id":252442608,"user":{"login":"rosmith76","id":20599957,"avatar_url":"https://avatars.githubusercontent.com/u/20599957?v=3","gravatar_id":"","url":"https://api.github.com/users/rosmith76","html_url":"https://github.com/rosmith76","followers_url":"https://api.github.com/users/rosmith76/followers","following_url":"https://api.github.com/users/rosmith76/following{/other_user}","gists_url":"https://api.github.com/users/rosmith76/gists{/gist_id}","starred_url":"https://api.github.com/users/rosmith76/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rosmith76/subscriptions","organizations_url":"https://api.github.com/users/rosmith76/orgs","repos_url":"https://api.github.com/users/rosmith76/repos","events_url":"https://api.github.com/users/rosmith76/events{/privacy}","received_events_url":"https://api.github.com/users/rosmith76/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T19:11:34Z","updated_at":"2016-10-08T19:11:34Z","body":"I do want to retrieve the data in the DOM element. It's the ID of the item I am trying to delete. \r\nThe HTML is still the same as it was posted above. Here it is again. \r\n```.html\r\n   <div class=\"modal fade\" id=\"delete-events-button\" tabindex=\"-1\"role=\"dialog\" aria-labelledby=\"deleteEventsModalLabel\">\r\n    <div class=\"modal-dialog\" role=\"document\">\r\n      <div class=\"modal-content\">\r\n        <form id=\"delete-event\">\r\n          <fieldset>\r\n            <legend>Delete Show</legend>\r\n            <input type= \"text\" name= \"[event]id\" placeholder=\"Event ID#\">\r\n            <input type=\"submit\" name=\"submit\" value=\"Delete\">\r\n          </fieldset>\r\n        </form>\r\n        <div class=\"modal-header\">\r\n          <button type=\"button\" class=\"close\" data-dismiss=\"modal\"\r\n            aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  </div>\r\n```"}}
{"actor":{"display_login":"rosmith76"}}