mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-12-22 19:01:27 +00:00
build full url
This commit is contained in:
parent
5b8accac62
commit
8cbffad86a
1 changed files with 10 additions and 7 deletions
17
src/http.ts
17
src/http.ts
|
@ -1879,7 +1879,7 @@ export class LemmyHttp {
|
|||
): Promise<UploadImageResponse> {
|
||||
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<SuccessResponse> {
|
||||
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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue