Minor Changes
-
#4135
e72c0d2b41f
Thanks @salihozdemir! - feat: Expose the query params to themeta
and add the ability to pass globalmeta
to data provider methods-
Added the ability to pass
meta
to data provider methods globally for specific resources.For example, to pass the
role
property to all data provider methods for theposts
resource, use the following code:import { Refine } from "@refinedev/core"; const App: React.FC = () => { return ( <Refine resources={[ { name: "posts", meta: { role: "editor", }, }, ]} /> ); };
Now, when you call any data hook with the
posts
resource, themeta
property will be accessible in the data provider methods.const dataProvider = { getList: async ({ resource, meta }) => { console.log(meta.role); // "editor" }, };
-
Added the query params to the
meta
property by default.For example, if you call the
useList
hook on theexample.com/posts?status=published
URL, themeta
property will be accessible in the data provider methods as follows:const dataProvider = { getList: async ({ resource, meta }) => { console.log(meta.status); // "published" }, };
-
Patch Changes
-
#4159
f7f590589e7
Thanks @aliemir! - fixed: missing resource meta in route compositionsAdded missing resource meta values when composing routes. This fixes the bug where the resource meta values does not included in the route composition.