fix: images is empty because languages undefined on querystring

This commit is contained in:
Fadhil Ahmad
2024-10-02 12:36:51 +08:00
parent 2abf448bb2
commit eaa5f9a751

View File

@@ -1,4 +1,9 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
export function parseOptions(options?: Record<string, any>): string {
return options ? new URLSearchParams(Object.entries(options)).toString() : '';
return options
? new URLSearchParams(
Object.entries(options)
.filter(([k, v]) => v) // remove undefined
).toString()
: '';
}