craftcms / element-api

Create a JSON API/Feed for your elements in Craft.
MIT License
498 stars 56 forks source link

Not correct error when use an argument in callback #137

Closed mmikhalko closed 2 years ago

mmikhalko commented 3 years ago

Description

If add not use argument to endpoint is returning incorrect response:

{"error":{"code":404,"message":"Endpoint has an invalid elementType"}}

Steps to reproduce

'api/articles' => function($someId) { .. }

  1. Add code
  2. Make a request
  3. Check error message of response
  4. Additional info

brandonkelly commented 2 years ago

Thanks for reporting that! Just released Element API 2.8.0 with a fix.