Skip to content

Commit faadd87

Browse files
committed
chore: make getUrlWithSearchParams generic
1 parent f62ad59 commit faadd87

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Common/Helper.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,10 @@ export const processDeployedTime = (lastDeployed, isArgoInstalled) => {
562562
* @param url URL to which the search params needs to be added
563563
* @param params Object for the search parameters
564564
*/
565-
export const getUrlWithSearchParams = (url: string, params: Record<string | number, any> = {}) => {
565+
export const getUrlWithSearchParams = <T extends string | number = string | number>(
566+
url: string,
567+
params = {} as Partial<Record<T, any>>,
568+
) => {
566569
const searchParams = new URLSearchParams()
567570
Object.keys(params).forEach((key) => {
568571
if (!EXCLUDED_FALSY_VALUES.includes(params[key])) {

0 commit comments

Comments
 (0)