chore: [app-router-migration 16]: migrate routing forms page (#13015)
Co-authored-by: Benny Joo <[email protected]>
This commit is contained in:
1 parent
dd7673b1f9
commit
bdd1d3a99d
29 files changed
+665
-333
No files matched your search
@@ -0,0 +1,11 @@
|
||||
// returns query object same as ctx.query but for app dir
|
||||
export const getQuery = (url: string, params: Record<string, string | string[]>) => {
|
||||
if (!url.length) {
|
||||
return params;
|
||||
}
|
||||
|
||||
const { searchParams } = new URL(url);
|
||||
const searchParamsObj = Object.fromEntries(searchParams.entries());
|
||||
|
||||
return { ...searchParamsObj, ...params };
|
||||
};
|
||||
Reference in new issue
Block a user