flat-fuchsia
flat-fuchsia14mo ago

why is simple-rest automatically increasing _end query param to 25 instead of 10?

Here is a screenshot of my mockAPI configuration and stub: wiremock endpoint: https://5z8l3.wiremockapi.cloud/teachers This my error message: GET https://5z8l3.wiremockapi.cloud/teachers?_end=25&_start=0& 404 (Not Found)
No description
No description
7 Replies
kapa.ai
kapa.ai14mo ago
Hi @soto76. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- I'm sorry, but the information extracts provided do not contain specific details about configuring or troubleshooting issues with WireMock or the specific endpoint you're trying to reach. However, a 404 error typically means that the requested resource could not be found on the server. This could be due to a misconfiguration in your mock API setup or an incorrect endpoint URL. In the context of refine, it's important to correctly set up your data provider to interact with your API. For example, in the tutorial on creating a data provider from scratch (https://refine.dev/docs/tutorial/understanding-dataprovider/create-dataprovider/), it shows how to define the getList method, which is used to fetch a list of resources. The getList method constructs a URL using the apiUrl and resource parameters, and uses pagination and sorting parameters to form the query string. If you're using a different tool or library to mock your API, you might need to refer to its specific documentation or seek help in relevant forums or communities. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai14mo ago
<@934748406096736296> kapa.ai is still learning and improving, please let us know how it did by reacting below
optimistic-gold
optimistic-gold14mo ago
hello @soto76 it shouldn't. you can see here, its increasing by pageSize. can you double check your parameters please https://github.com/refinedev/refine/blob/dd7483e9ef4d7033e2d53ca47935f9d2b1023ba7/packages/simple-rest/src/provider.ts#L38
GitHub
refine/packages/simple-rest/src/provider.ts at dd7483e9ef4d7033e2d5...
Build your React-based CRUD applications, without constraints. 🌟 Star to support our work! - refinedev/refine
flat-fuchsia
flat-fuchsiaOP14mo ago
@alicanerdurmaz hmm I doubled check my query parameters in my wiremock configuration and I have _end set to 10, is that what you mean?
optimistic-gold
optimistic-gold14mo ago
I don't know what is wiremock. in our examples everything works as expected. if you provide reproducible example we can try to debug but as you can see in source code simpl-rest depends on pageSize and current. you can't modify star or end default pageSize is 10
flat-fuchsia
flat-fuchsiaOP14mo ago
hmmm yeah i saw that, so I'm not sure what's happening. Let me try another mock API service and see if the same thing is happening. Thank you for your help!
optimistic-gold
optimistic-gold14mo ago
your welcome. sorry I'm not familiar with wiremock for example antd table or material ui table can modify pageSize after table componen is mounted maybe this can be cause a problem