Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using HTTP Delete #3652

Closed
mioteck opened this issue Jul 19, 2019 · 3 comments
Closed

Error when using HTTP Delete #3652

mioteck opened this issue Jul 19, 2019 · 3 comments

Comments

@mioteck
Copy link

mioteck commented Jul 19, 2019

Informations

  • Node.js version : v12.6.0
  • NPM version : 6.9.0
  • Strapi version : 3.0.0-beta.13
  • Database : SQLite
  • Operating system : Windows 10

Description
When I try to delete an entry with a HTTP Delete request, I get the following error :

[2019-07-19T22:27:12.548Z] error CustomError: No Rows Deleted
at Child.<anonymous> (...\node_modules\bookshelf\lib\model.js:1251:19)
at Child.tryCatcher (...\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (...\node_modules\bluebird\js\release\promise.js:517:31)
at Promise._settlePromise (...\node_modules\bluebird\js\release\promise.js:574:18)
at Promise._settlePromise0 (...\node_modules\bluebird\js\release\promise.js:619:10)
at Promise._settlePromises (...\node_modules\bluebird\js\release\promise.js:699:18)
at _drainQueueStep (...\node_modules\bluebird\js\release\async.js:138:12)
at _drainQueue (...\node_modules\bluebird\js\release\async.js:131:9)
at Async._drainQueues (...\node_modules\bluebird\js\release\async.js:147:5)
at Immediate.Async.drainQueues [as _onImmediate (...\node_modules\bluebird\js\release\async.js:17:14)
at processImmediate (internal/timers.js:439:21)
[2019-07-19T22:27:12.548Z] debug DELETE /tests/delete?id=2 (10 ms)

This is my model for this request :

{
  "connection": "default",
  "collectionName": "tests",
  "info": {
    "name": "test",
    "description": ""
  },
  "options": {
    "increments": true,
    "timestamps": [
      "created_at",
      "updated_at"
    ],
    "comment": ""
  },
  "attributes": {
    "Name": {
      "type": "string"
    },
    "Bool": {
      "type": "boolean",
      "default": true
    }
  }
}

And I'm using Postman to test my HTTP request :

Request type : DELETE
Request url : [url]/tests/delete?id=[index]

@lauriejim
Copy link
Contributor

Hello @mioteck !
If you check your ./api/test/config/routes.json file, you will see the route to delete an entry is not [url]/tests/delete?id=[index] but is [url]/tests/delete/[index]
Can you try the correct format and tell me if it works.

@mioteck
Copy link
Author

mioteck commented Jul 22, 2019

Hello @lauriejim
Indeed, I was wrong ! My bad !

Thank's !

@derrickmehaffy
Copy link
Member

Marking as closed as user stated the issue was solved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants