What's the recommended way to handle API requests that aren't closely-couped with a resource?
For example, I have an API request that enqueues an async job that updates multiple entities.
custom method in your data provider.custom method in your data provider to handle these custom requests on the backend.custom method in your data provider.useCustomuseCustomuseCustomuseCustomimport { useCustom } from "@refinedev/core";
const MyComponent = () => {
const { mutate } = useCustom({
url: "/api/enqueue-job",
method: "post",
});
const handleEnqueueJob = () => {
mutate({
payload: {
// Your job parameters here
},
});
};
return <button onClick={handleEnqueueJob}>Enqueue Job</button>;
};