chore: [app-router-migration 16]: migrate routing forms page (#13015)

Co-authored-by: Benny Joo <[email protected]>
This commit is contained in:
DmytroHryshynandBenny Joo authored and GitHub committed 2024-01-19 11:57:08 -07:00
1 parent dd7673b1f9
commit bdd1d3a99d
29 files changed
+665 -333

No files matched your search

+11
View File
@@ -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 };
};