equal-aqua
equal-aqua6mo ago

with useDataGrid how to omit query args

how to not add ?& to /resource?& when using useDataGrid
11 Replies
kapa.ai
kapa.ai6mo ago
Hi @Joe Gaffney. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the useDataGrid documentation (https://refine.dev/docs/ui-integrations/material-ui/hooks/use-data-grid) for more information. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6mo ago
<@422289470487003153> kapa.ai is still learning and improving, please let us know how it did by reacting below
equal-aqua
equal-aqua6mo ago
@kapa.ai is extend from use table how would i omit ?& on that
kapa.ai
kapa.ai6mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Based on the information provided in the extracts, it seems that the issue of ?& being added when calling the API in useTable is related to the data provider. The request is generated by the data provider, and the ?& is added without checking the existence of queries and filters. The issue was identified in this line of code: https://github.com/refinedev/refine/blob/fba8f7370057fa8d4c27de6b9432fec4ccada268/packages/simple-rest/src/provider.ts#L50 The solution would involve manually adding ? and/or & depending on the existence of queries and filters. However, the specific implementation would depend on the data provider you are using and the structure of your code. Unfortunately, the extracts do not provide a direct solution or code example for this issue. For more detailed guidance, you may want to refer to the Refine useTable documentation (https://refine.dev/docs/ui-integrations/ant-design/hooks/use-table/) or seek help from the Refine community. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6mo ago
<@422289470487003153> kapa.ai is still learning and improving, please let us know how it did by reacting below
equal-aqua
equal-aqua6mo ago
@kapa.ai yes i am using the simpleRest data provider how do i remove ?& from that
kapa.ai
kapa.ai6mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Based on the information from the GitHub issue discussion, the ?& is added in the simple-rest data provider's code. The issue arises from this line: https://github.com/refinedev/refine/blob/fba8f7370057fa8d4c27de6b9432fec4ccada268/packages/simple-rest/src/provider.ts#L50 A quick solution suggested in the discussion is to swizzle the data provider and fix it locally. Swizzling allows you to override the default behavior of the data provider. You can find more information on how to swizzle a data provider in the Refine documentation (https://refine.dev/docs/tutorial/understanding-dataprovider/swizzle/#how-do-you-use-swizzle-to-create-an-data-provider). However, please note that this is a workaround and the actual solution would involve modifying the data provider's code to add ? and/or & depending on the existence of queries and filters. This change would need to be made in the Refine codebase itself. If you're comfortable with contributing to open-source projects, the Refine team has indicated that they're open to contributions for this issue. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6mo ago
<@422289470487003153> kapa.ai is still learning and improving, please let us know how it did by reacting below
equal-aqua
equal-aqua6mo ago
@kapa.ai do you have a link to the issue disccusion
kapa.ai
kapa.ai6mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- I'm sorry for the confusion, but the extracts provided do not contain a link to a specific issue discussion about removing ?& from the simple-rest data provider in Refine. For more detailed guidance, you may want to refer to the Refine documentation (https://refine.dev/docs/) or seek help from the Refine community on GitHub Discussions (https://github.com/refinedev/refine/discussions) or Discord (https://discord.gg/refine). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai6mo ago
<@422289470487003153> kapa.ai is still learning and improving, please let us know how it did by reacting below