Closed korayrubicoda closed 1 year ago
Hi @korayrubicoda, is the field in which you store the coordinates also named "coords"? In case the url is constructed wrongly it will return all entries.
yes cordinates name "coords"
Oh, you should test on real coordinates from the map because they are stored as geospatial data in the DB. Also try omitting the populate=* but that should not cause any problems. If that does not work I will try replicating this.
I tested the coordinate and it's correct and deleted populate=* i change url and it's not working
I see now. For some reason your url starts with /v1
instead of /api
and our middleware determines the collection type with this code const collectionType = url.replace("/api/", "").split("/")[0].split("?")[0];
And since there is no "/api" in your request it will fail to get the correct collectionType and lets the request through.
If you need a hotfix it should be fixed by changing the line 24 of the middleware to const collectionType = url.replace(strapi.config.api.rest.prefix, "").split("/")[0].split("?")[0];
I will also include this into the source code and publish a new version but I will do it tomorrow at the earliest.
ahh sorry i changed the code to /v1 in the instructions when installing postgres I fixed it, now it works thank you :)
Glad it works :)
Closed by #39
Bug report
Describe the bug
I am using your plugin for the strap, everything was going well, but when I make api request, it pulls all the data Api Url http://localhost:1337/v1/articles?$location[coords]=49.200949303006055,16.623833585841673,5000&populate=*
Screenshots
System