{"action":"created","issue":{"url":"https://api.github.com/repos/ga-wdi-boston/team-project/issues/343","repository_url":"https://api.github.com/repos/ga-wdi-boston/team-project","labels_url":"https://api.github.com/repos/ga-wdi-boston/team-project/issues/343/labels{/name}","comments_url":"https://api.github.com/repos/ga-wdi-boston/team-project/issues/343/comments","events_url":"https://api.github.com/repos/ga-wdi-boston/team-project/issues/343/events","html_url":"https://github.com/ga-wdi-boston/team-project/issues/343","id":238874828,"number":343,"title":"Delete/Update Requests with Mongoose","user":{"login":"slammyde7113","id":27901872,"avatar_url":"https://avatars0.githubusercontent.com/u/27901872?v=3","gravatar_id":"","url":"https://api.github.com/users/slammyde7113","html_url":"https://github.com/slammyde7113","followers_url":"https://api.github.com/users/slammyde7113/followers","following_url":"https://api.github.com/users/slammyde7113/following{/other_user}","gists_url":"https://api.github.com/users/slammyde7113/gists{/gist_id}","starred_url":"https://api.github.com/users/slammyde7113/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slammyde7113/subscriptions","organizations_url":"https://api.github.com/users/slammyde7113/orgs","repos_url":"https://api.github.com/users/slammyde7113/repos","events_url":"https://api.github.com/users/slammyde7113/events{/privacy}","received_events_url":"https://api.github.com/users/slammyde7113/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-27T14:40:40Z","updated_at":"2017-06-27T14:48:00Z","closed_at":null,"body":"We're having trouble with the delete and update requests for our tables. Here some of our code to give context.\r\nGet Request Result for Products Table:\r\n```\r\n{\r\n    \"product\": {\r\n        \"_id\": \"5951976290fe850d650ae4c1\",\r\n        \"name\": \"test\",\r\n        \"price\": 0,\r\n        \"description\": \"test\",\r\n        \"_owner\": \"595153ad6f18427ef38c416b\",\r\n        \"__v\": 0,\r\n        \"id\": \"5951976290fe850d650ae4c1\",\r\n        \"editable\": false\r\n    }\r\n}\r\n```\r\nDelete Request Curl Script:\r\n```\r\ncurl -X DELETE \\\r\n  http://localhost:4741/products/5951976290fe850d650ae4c1 \\\r\n  -H 'authorization: Token token=B3vDp2Ay310wxNjPx5EMecMSFmqnUnmnD98yeaLnsjs=--FXJqlTfi/3Xoj15rjF8wZhbMTHN2tkNZaN5ej+WAG4U=' \\\r\n  -H 'cache-control: no-cache' \\\r\n  -H 'content-type: application/json' \\\r\n```\r\nDelete Request Result:\r\n```\r\n{\r\n    \"error\": {\r\n        \"message\": \"404 Not Found\",\r\n        \"error\": {\r\n            \"name\": \"HttpError\",\r\n            \"status\": 404,\r\n            \"message\": \"404 Not Found\"\r\n        }\r\n    }\r\n}\r\n```\r\nI've written delete requests before and I haven't encountered this issue before. I'm using the same delete controller as the examples model uses (with modifications of course). Normally I'd console.log my request and see what I'm sending but its not being executed in the controller. Here's an example:\r\n```\r\nconst destroy = (req, res, next) => {\r\n  console.log(req)\r\n  req.product.remove()\r\n    .then(() => res.sendStatus(204))\r\n    .catch(next)\r\n}\r\n```\r\nAny help would be greatly appreciated.\r\n"},"comment":{"url":"https://api.github.com/repos/ga-wdi-boston/team-project/issues/comments/311381948","html_url":"https://github.com/ga-wdi-boston/team-project/issues/343#issuecomment-311381948","issue_url":"https://api.github.com/repos/ga-wdi-boston/team-project/issues/343","id":311381948,"user":{"login":"slammyde7113","id":27901872,"avatar_url":"https://avatars0.githubusercontent.com/u/27901872?v=3","gravatar_id":"","url":"https://api.github.com/users/slammyde7113","html_url":"https://github.com/slammyde7113","followers_url":"https://api.github.com/users/slammyde7113/followers","following_url":"https://api.github.com/users/slammyde7113/following{/other_user}","gists_url":"https://api.github.com/users/slammyde7113/gists{/gist_id}","starred_url":"https://api.github.com/users/slammyde7113/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slammyde7113/subscriptions","organizations_url":"https://api.github.com/users/slammyde7113/orgs","repos_url":"https://api.github.com/users/slammyde7113/repos","events_url":"https://api.github.com/users/slammyde7113/events{/privacy}","received_events_url":"https://api.github.com/users/slammyde7113/received_events","type":"User","site_admin":false},"created_at":"2017-06-27T14:48:00Z","updated_at":"2017-06-27T14:48:00Z","body":"This works in the mongo shell thought:\r\n```\r\ndb.products.remove({ \"_id\": ObjectId(\"5951976290fe850d650ae4c1\")})\r\nWriteResult({ \"nRemoved\" : 1 })\r\n```\r\n"}}
{"actor":{"display_login":"slammyde7113"}}