From ea8cab69f4c0e2cc17c7967f4f35cb488daa98ad Mon Sep 17 00:00:00 2001 From: Cavanaugh Richards Date: Wed, 21 Jun 2023 17:09:52 -0500 Subject: [PATCH] Add default value to encodeGetParams body type param. Fixes #146 --- src/http.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http.ts b/src/http.ts index 8f0b8e0..cdc15dd 100644 --- a/src/http.ts +++ b/src/http.ts @@ -1335,7 +1335,7 @@ export class LemmyHttp { } } -function encodeGetParams(p: BodyType): string { +function encodeGetParams(p: BodyType = {}): string { return Object.entries(p) .filter(kv => !!kv[1]) .map(kv => kv.map(encodeURIComponent).join("="))