Directus JS SDK adds an extra slash to the API link

Viewed 306

I wrote this code to fetch some data using the JS SDK (a third-party library) :

directus.items('configuration').read<TConfiguration>({ single: true });

This will generate a get query to

/items/configuration/?single=true

which returns an 404 Not Found error.

The right end point is without a slash '/' :

/items/configuration?single=true

I checked the documentation and I didn't find a way to remove this extra slash. And I don't want to use Apache or htaccess to ignore it.

Is there a native Directus option to remove it ?

EDIT 1 : It seems this is a bug in the library itself. The slash is hard coded there and maybe the only way to ignore it is to use htaccess.

1 Answers

I guess it's hard coded in the library.

The code is from @directus/sdk-js

enter image description here

Related