refine icon indicating copy to clipboard operation
refine copied to clipboard

fix(simple-rest): fix generated url with query string

Open amanzrx4 opened this issue 1 year ago • 5 comments

fix: dataProvider.getList method adds ? to the request url when there is no filters, sorters and pagination in the request. #5359

- Expected
+ Received

- "https://api.fake-rest.refine.dev/categories",
+ "https://api.fake-rest.refine.dev/categories?",

From now on, dataProvider.getList method will not add ? to the request url when there is no filters, sorters and pagination in the request.

Test plan (required)

image

Closing issues

closes #5359

Self Check before Merge

Please check all items below before review.

  • [x] Corresponding issues are created/updated or not needed
  • [x] Docs are updated/provided or not needed
  • [x] Examples are updated/provided or not needed
  • [x] TypeScript definitions are updated/provided or not needed
  • [x] Tests are updated/provided or not needed
  • [x] Changesets are provided or not needed

amanzrx4 avatar Dec 15 '23 10:12 amanzrx4

🦋 Changeset detected

Latest commit: 3f19850182003e4107edd759e360d6fa4de7ac0e

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Dec 15 '23 10:12 changeset-bot[bot]

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 949c59384e44820b9343cf0ef1d54f60563cb855. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
lerna run build --include-dependencies --scope @refinedev/core --no-bail --scope=access-control-casbin --scope=auth-antd --scope=access-control-cerbos --scope=accessControl --scope=antdAuditLog --scope=auth-auth0 --scope=app-crm --scope=app-crm-minimal --scope=audit-log-provider --scope=auth-chakra-ui --scope=auditLogProvider --scope=auth-kinde --s...
lerna run build --include-dependencies --scope @refinedev/core --no-bail --scope=blog-mui-datagrid --scope=base-chakra-ui --scope=blog-next-refine-pwa --scope=blog-ra-chakra-tutorial --scope=blog-react-aria --scope=base-mantine --scope=blog-react-dnd --scope=blog-react-hook-dynamic-form --scope=blog-react-hot-toast --scope=base-material-ui --scope=...
lerna run build --include-dependencies --scope @refinedev/core --no-bail --scope=use-modal-antd --scope=table-material-ui-use-data-grid --scope=use-simple-list-antd --scope=vite --scope=web3 --scope=table-material-ui-use-delete-many --scope=with-custom-pages --scope=with-cypress --scope=with-javascript --scope=table-material-ui-use-update-many --sc...
lerna run build --include-dependencies --scope @refinedev/core --no-bail --scope=data-provider-appwrite-tutorial-docs --scope=form-mantine-use-modal-form --scope=data-provider-hasura --scope=data-provider-multiple --scope=data-provider-nestjs-query --scope=form-mantine-use-steps-form --scope=data-provider-nestjsx-crud --scope=data-provider-nhost --...
lerna run build --include-dependencies --scope @refinedev/core --no-bail --scope=form-mui-use-drawer-form --scope=form-react-hook-form-use-steps-form --scope=form-mui-use-form --scope=form-mui-use-modal-form --scope=form-mui-use-steps-form --scope=form-save-and-continue --scope=i18n --scope=i18n-nextjs --scope=i18n-react --scope=inferencer-antd --s...
lerna run build --include-dependencies --scope @refinedev/core --no-bail --scope=multi-tenancy-strapi --scope=server-side-form-validation-chakra-ui --scope=mutation-mode --scope=new-routing-example --scope=pixels --scope=server-side-form-validation-mantine --scope=pixels-admin --scope=react-location --scope=reactToastify --scope=server-side-form-va...
lerna run build --include-dependencies --scope @refinedev/core --no-bail --scope=blog-win95 --scope=form-antd-use-modal-form --scope=calendar --scope=calendar-app --scope=cloud --scope=form-antd-use-steps-form --scope=command-palette-kbar --scope=commandPalette --scope=core --scope=form-chakra-ui-mutation-mode --scope=core-use-import --scope=core-u...
lerna run build --include-dependencies --scope @refinedev/core --no-bail --scope=template-mui --scope=table-chakra-ui-advanced --scope=theme-antd-demo --scope=theme-chakra-ui-demo --scope=theme-mantine-demo --scope=table-chakra-ui-basic --scope=theme-material-ui-demo --scope=theme-mui-demo --scope=tutorial --scope=table-handson --scope=tutorial-ant...

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Dec 18 '23 07:12 nx-cloud[bot]

I've added. Could you check @BatuhanW

amanzrx4 avatar Dec 18 '23 09:12 amanzrx4

@BatuhanW I've also updated the fn implementation here

amanzrx4 avatar Dec 18 '23 09:12 amanzrx4

@BatuhanW I've also updated the fn implementation here

Thanks @amanzrx4! Looks great! We'll review it soon! Assigned it to January release.

There are 2 minor updates:

  • Add a test for the new utility file
  • Add new file to refine.config.js. https://github.com/refinedev/refine/blob/7c8827b43d9e378818be6ee23032925c97ce02d5/packages/simple-rest/refine.config.js#L18

We need to add this file to refine.config.js, because if someone swizzles this data provider, it won't copy this file to users' directory.

BatuhanW avatar Dec 18 '23 10:12 BatuhanW