Open anil1712 opened 6 months ago
@Ballonek can you please suggest me something regarding this?
Hi @anil1712, are you sure "coords" is also name of the field you are filtering by? It was just an example you are supposed to change that based on the name of your field
@omikulcik Yes I did change based on the app, but its not working, do you have any working example with Custom APIs?
@omikulcik Same question from my side. How do we have to "configure" the filters when using the entity service.
await strapi.entityService.findMany('api::entity.entity',
{
filters: WHAT_TO_SET_HERE?
}
)
Can you provide an example here, please?
UPDATE I figured out, that your plugin is doing some work before entering the controller method (core controller). How can I apply these changes to a custom controller?
Hi,
Everything is working fine with inbuilt api but when I am trying to apply the filter using custom api its not filtering the records based on location provided in query params. Here is my code snippet
const response = await strapi.entityService.findMany("api::my-custom-location.my-custom-location", {...ctx.query} );
Here is the URL
http://localhost:1337/api/restaurants?$location[coords]=49.200949303006055,16.623833585841673,5000
Thanks, Anil