From 8cbffad86a65d58449df6371a3660cb98144d8b5 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 17 Dec 2024 11:10:06 +0100 Subject: [PATCH] build full url --- src/http.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/http.ts b/src/http.ts index 529b58f..3fb3a36 100644 --- a/src/http.ts +++ b/src/http.ts @@ -1879,7 +1879,7 @@ export class LemmyHttp { ): Promise { const formData = createFormData(image); - const response = await this.#fetchFunction("/api/v4/image", { + const response = await this.#fetchFunction(this.#buildFullUrl("/image"), { ...options, method: HttpType.Post, body: formData as unknown as BodyInit, @@ -1899,12 +1899,15 @@ export class LemmyHttp { ): Promise { const formData = createFormData(image); - const response = await this.#fetchFunction("/api/v4/account/avatar", { - ...options, - method: HttpType.Post, - body: formData as unknown as BodyInit, - headers: this.#headers, - }); + const response = await this.#fetchFunction( + this.#buildFullUrl("/account/avatar"), + { + ...options, + method: HttpType.Post, + body: formData as unknown as BodyInit, + headers: this.#headers, + }, + ); return response.json(); }