From 42d730aa2908003cfb0dcf0c57e9b70793c88ddc Mon Sep 17 00:00:00 2001 From: Omkar Bansod Date: Fri, 6 Dec 2024 13:01:53 +0530 Subject: [PATCH] feat(core): update useNavigation to pass meta.query as URL params (#6558) Co-authored-by: Younes Henni --- .changeset/dry-tomatoes-beg.md | 7 +++++++ packages/core/src/hooks/navigation/index.ts | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 .changeset/dry-tomatoes-beg.md diff --git a/.changeset/dry-tomatoes-beg.md b/.changeset/dry-tomatoes-beg.md new file mode 100644 index 000000000000..7d8f9f8069c8 --- /dev/null +++ b/.changeset/dry-tomatoes-beg.md @@ -0,0 +1,7 @@ +--- +"@refinedev/core": minor +--- + +This PR fixes an issue where the ListButton component doesn't include a query filter in the navigation URL. + +[Resolves #6528](https://github.com/refinedev/refine/issues/6528) diff --git a/packages/core/src/hooks/navigation/index.ts b/packages/core/src/hooks/navigation/index.ts index daac7ff6a5ae..22b905ca2f91 100644 --- a/packages/core/src/hooks/navigation/index.ts +++ b/packages/core/src/hooks/navigation/index.ts @@ -85,6 +85,7 @@ export const useNavigation = () => { return go({ to: composeRoute(createActionRoute, resourceItem?.meta, parsed, meta), type: "path", + query: meta.query, }) as string; }; @@ -138,6 +139,7 @@ export const useNavigation = () => { id: encodedId, }), type: "path", + query: meta.query, }) as string; }; @@ -192,6 +194,7 @@ export const useNavigation = () => { id: encodedId, }), type: "path", + query: meta.query, }) as string; }; @@ -245,6 +248,7 @@ export const useNavigation = () => { id: encodedId, }), type: "path", + query: meta.query, }) as string; }; @@ -295,6 +299,7 @@ export const useNavigation = () => { return go({ to: composeRoute(listActionRoute, resourceItem?.meta, parsed, meta), type: "path", + query: meta.query, }) as string; };