From 36123c8cc93ccdc13001f7155562dc33bf9522ec Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 10 Nov 2024 10:36:47 -0500 Subject: [PATCH] Another endpoint. --- src/http.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/http.ts b/src/http.ts index e51e2a2..ad456a5 100644 --- a/src/http.ts +++ b/src/http.ts @@ -139,6 +139,7 @@ import { ListCommentLikesResponse } from "./types/ListCommentLikesResponse"; import { HidePost } from "./types/HidePost"; import { ListMedia } from "./types/ListMedia"; import { ListMediaResponse } from "./types/ListMediaResponse"; +import { GetRegistrationApplication } from "./types/GetRegistrationApplication"; enum HttpType { Get = "GET", @@ -1330,6 +1331,18 @@ export class LemmyHttp { >(HttpType.Put, "/admin/registration_application/approve", form); } + /** + * Get the application a user submitted when they first registered their account + * + * `HTTP.GET /admin/registration_application` + */ + getRegistrationApplication(form: GetRegistrationApplication) { + return this.#wrapper< + GetRegistrationApplication, + RegistrationApplicationResponse + >(HttpType.Get, "/admin/registration_application", form); + } + /** * Purge / Delete a person from the database. * @@ -1526,7 +1539,7 @@ export class LemmyHttp { try { json = await response.json(); - } catch (error) { + } catch { throw new Error(response.statusText); }