refine icon indicating copy to clipboard operation
refine copied to clipboard

feat(core): add ability to call custom methods from data providers

Open aliemir opened this issue 2 years ago • 2 comments

Example Usage

const { mutate } = useCustomMethod("myCustomMethod", { as: "mutation" });
const { data, isLoading } = useCustomMethod("myCustomMethod", { as: "query" });
const { data, isLoading } = useCustomMethod("myCustomMethod");

Example Implementation

import simpleRestDataProvider from "@refinedev/simple-rest";

const dataProvider = {
  ...simpleRestDataProvider("https://my.api.com"),
  customMethods: {
    myCustomMethod: ({ params, meta }) => ({
      data: {},
    }),
  },
};

Self Check before Merge

Please check all items below before review.

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

aliemir avatar Dec 29 '23 14:12 aliemir

🦋 Changeset detected

Latest commit: 5e57b5317fc3833d9956df69048ac53546a3711d

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 29 '23 14:12 changeset-bot[bot]

☁️ Nx Cloud Report

We didn't find any information for the current pull request with the commit 5e57b5317fc3833d9956df69048ac53546a3711d. Please verify you are running the latest version of the NxCloud runner.

Check the Nx Cloud Source Control Integration documentation for more information.

Alternatively, you can contact us at [email protected].


Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Dec 29 '23 14:12 nx-cloud[bot]

We'll clarify the details more later.

BatuhanW avatar Jan 31 '24 12:01 BatuhanW