Adding blockInstance fn.

This commit is contained in:
Dessalines 2023-09-20 10:46:18 -04:00
parent 35716bd872
commit 357316a762
2 changed files with 15 additions and 1 deletions

View file

@ -127,6 +127,8 @@ import { VerifyEmail } from "./types/VerifyEmail";
import { VerifyEmailResponse } from "./types/VerifyEmailResponse";
import { UploadImage, UploadImageResponse, VERSION } from "./types/others";
import { HideCommunity } from "./types/HideCommunity";
import { BlockInstance } from "./types/BlockInstance";
import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
enum HttpType {
Get = "GET",
@ -1259,6 +1261,19 @@ export class LemmyHttp {
);
}
/**
* Block an instance.
*
* `HTTP.Post /site/block`
*/
blockInstance(form: BlockInstance) {
return this.#wrapper<BlockInstance, BlockInstanceResponse>(
HttpType.Post,
"/site/block",
form,
);
}
/**
* Upload an image to the server.
*/

View file

@ -4,5 +4,4 @@ import type { InstanceId } from "./InstanceId";
export interface BlockInstance {
instance_id: InstanceId;
block: boolean;
auth: string;
}