mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-29 07:41:12 +00:00
Adding blockInstance fn.
This commit is contained in:
parent
35716bd872
commit
357316a762
2 changed files with 15 additions and 1 deletions
15
src/http.ts
15
src/http.ts
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -4,5 +4,4 @@ import type { InstanceId } from "./InstanceId";
|
|||
export interface BlockInstance {
|
||||
instance_id: InstanceId;
|
||||
block: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue