Add default value to encodeGetParams body type param.

Fixes #146
This commit is contained in:
Cavanaugh Richards 2023-06-21 17:09:52 -05:00
parent a336b2dccd
commit ea8cab69f4
No known key found for this signature in database
GPG key ID: 6EDF7F29C18D7689

View file

@ -1335,7 +1335,7 @@ export class LemmyHttp {
}
}
function encodeGetParams<BodyType extends object>(p: BodyType): string {
function encodeGetParams<BodyType extends object>(p: BodyType = <BodyType>{}): string {
return Object.entries(p)
.filter(kv => !!kv[1])
.map(kv => kv.map(encodeURIComponent).join("="))