mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-09 23:15:36 +00:00
refactor: collection controllers and service
This commit is contained in:
@@ -34,3 +34,11 @@ export const generateShareUrl = (
|
||||
if (typeof window === 'undefined') return pathname;
|
||||
return `${window.location.origin}${pathname}`;
|
||||
};
|
||||
|
||||
export const buildUrl = (url: string, params: Record<string, string>) => {
|
||||
const urlObj = new URL(url);
|
||||
Object.entries(params).forEach(([key, value]) => {
|
||||
urlObj.searchParams.set(key, value);
|
||||
});
|
||||
return urlObj.toString();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user