useSelect encoded query params

My backend is returning an error because useSelect is adding extra stuff i dont need to the call.. how can i omit the encoded useselect queries at hook level? i am getting an error because it's adding invalid encoded queries automatically http://127.0.0.1:8090/api/collections/categories/records?page=1&perPage=500&skipTotal=1&sort=undefined&filter= 400 (Bad Request) this is the call the useSelect is making, i need to make it without any of the query parameters
4 Replies
kapa.ai
kapa.ai4mo ago
Hi @hack1nt0sh. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the knowledge sources provided, there isn't a direct way to omit the encoded queries at the hook level in useSelect. The useSelect hook in Refine is designed to automatically add certain query parameters to the API call for handling pagination, sorting, and filtering. However, you can customize the behavior of your API calls by creating a custom data provider. This allows you to control how your application interacts with your API, including the structure of the requests and the handling of responses. If you're facing issues with the automatically added query parameters, it might be worth checking your backend implementation to ensure it's compatible with the way Refine structures its API calls. For more detailed information on how to customize your data provider, you can refer to the Refine documentation (https://refine.dev/docs/api-references/providers/data-provider). Please note that this is a general suggestion and might not directly solve your issue as the provided knowledge sources do not contain a specific solution for this problem. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4mo ago
<@204800367836266497> kapa.ai is still learning and improving, please let us know how it did by reacting below
notable-maroon
notable-maroon4mo ago
Hey @hack1nt0sh you can swizzle your data provider and remove query parameters in list method. https://refine.dev/docs/packages/cli/#swizzle
CLI | Refine
Refine CLI is a command line application that allows you to interact with your Refine project and perform some tasks. This includes creating a new resource, managing updates, swizzle components, and runs your project (build, start, dev).
flat-fuchsia
flat-fuchsia3mo ago
I'd like to auto base64encode and base64decode to avoid urls like http://localhost:5173/apps/builder?pageSize=10&current=1&sorters[0][field]=created_at&sorters[0][order]=desc which I don't like aesthetically - anyway to do that?