mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-26 14:21:12 +00:00
Properly handle pictrs delete image response
This commit is contained in:
parent
73e172cb2d
commit
18bc0bcb5d
1 changed files with 2 additions and 2 deletions
|
@ -1409,7 +1409,7 @@ export class LemmyHttp {
|
||||||
/**
|
/**
|
||||||
* Delete a pictrs image
|
* Delete a pictrs image
|
||||||
*/
|
*/
|
||||||
async deleteImage({ token, filename }: DeleteImage): Promise<any> {
|
async deleteImage({ token, filename }: DeleteImage): Promise<boolean> {
|
||||||
const deleteUrl = `${this.#pictrsUrl}/delete/${token}/${filename}`;
|
const deleteUrl = `${this.#pictrsUrl}/delete/${token}/${filename}`;
|
||||||
|
|
||||||
const response = await this.#fetchFunction(deleteUrl, {
|
const response = await this.#fetchFunction(deleteUrl, {
|
||||||
|
@ -1417,7 +1417,7 @@ export class LemmyHttp {
|
||||||
headers: this.#headers,
|
headers: this.#headers,
|
||||||
});
|
});
|
||||||
|
|
||||||
return await response.json();
|
return (await response.status) == 204;
|
||||||
}
|
}
|
||||||
|
|
||||||
#buildFullUrl(endpoint: string) {
|
#buildFullUrl(endpoint: string) {
|
||||||
|
|
Loading…
Reference in a new issue