I try to get 3 random items from the database. Here's the code:
client.getItems('items',{
fields:'*.*',
limit:3,
sort:'?'
})
But I get "Internal server error" as a request. Sorting by field names (even with minus in front) works great, just to mention. ;) Maybe I do simething wrong? The JS SDK docs don't show the exact filtering procedure.
Hmm weird. Could you try it directly on the API? /items/items?fields=*.*&limit=3&sort=?
No matter what type of API I use, i get the same "internal Server Error". Everything works well with any other sort method. Here's my browser console.
client.get('/items/words?fields=*.*&limit=3&sort=?').then(r=>console.log(r)).catch(e=>console.log(e))
Promise { <state>: "pending" }
Object { code: null, message: "Internal Server Error" }
http://etovoteto.ru/api/public/_/items/words here's the API request to try (It's currently the 7.0.17 version)
Thanks! I was trying to figure out if it was a bug in the SDK or the API 馃檪
@DeFUCC Could you check if there's anything useful logged in the /logs/ folder? That might give us a heads up of what the problem is
The logs don't show any particular errors after such calls. There are mostly expired token errors in logs.
Thanks for reporting this @DeFUCC. I was able to reproduce it. I am going to find what the bug is and fix it on Friday.
Here is the error in the logs (without the stack trace):
[2019-02-20 16:59:02] api[_].ERROR: Error: Call to a member function isAlias() on null in /Users/welling/src/api/src/core/Directus/Database/TableGateway/RelationalTableGateway.php:1572
Waiting for the v2.0.19 release. Is it coming soon?
This Monday @DeFUCC
Most helpful comment
Thanks for reporting this @DeFUCC. I was able to reproduce it. I am going to find what the bug is and fix it on Friday.
Here is the error in the logs (without the stack trace):