mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-12-04 18:21:12 +00:00
fix methods
This commit is contained in:
parent
dc21cc8513
commit
28c4b5545b
1 changed files with 34 additions and 5 deletions
39
src/http.ts
39
src/http.ts
|
@ -129,8 +129,6 @@ import {
|
|||
VERSION,
|
||||
} from "./other_types";
|
||||
import { HideCommunity } from "./types/HideCommunity";
|
||||
import { BlockInstance } from "./types/BlockInstance";
|
||||
import { BlockInstanceResponse } from "./types/BlockInstanceResponse";
|
||||
import { GenerateTotpSecretResponse } from "./types/GenerateTotpSecretResponse";
|
||||
import { UpdateTotp } from "./types/UpdateTotp";
|
||||
import { UpdateTotpResponse } from "./types/UpdateTotpResponse";
|
||||
|
@ -160,6 +158,9 @@ import { GetCommunityPendingFollowsCountResponse } from "./types/GetCommunityPen
|
|||
import { ListCommunityPendingFollowsResponse } from "./types/ListCommunityPendingFollowsResponse";
|
||||
import { ListCommunityPendingFollows } from "./types/ListCommunityPendingFollows";
|
||||
import { CommunityId } from "./types/CommunityId";
|
||||
import { UserBlockInstanceParams } from "./types/UserBlockInstanceParams";
|
||||
import { AdminAllowInstanceParams } from "./types/AdminAllowInstanceParams";
|
||||
import { AdminBlockInstanceParams } from "./types/AdminBlockInstanceParams";
|
||||
|
||||
enum HttpType {
|
||||
Get = "GET",
|
||||
|
@ -1786,12 +1787,12 @@ export class LemmyHttp {
|
|||
}
|
||||
|
||||
/**
|
||||
* Block an instance.
|
||||
* Block an instance as user.
|
||||
*
|
||||
* `HTTP.Post /site/block`
|
||||
*/
|
||||
blockInstance(form: BlockInstance, options?: RequestOptions) {
|
||||
return this.#wrapper<BlockInstance, BlockInstanceResponse>(
|
||||
userBlockInstance(form: UserBlockInstanceParams, options?: RequestOptions) {
|
||||
return this.#wrapper<UserBlockInstanceParams, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/site/block",
|
||||
form,
|
||||
|
@ -1799,6 +1800,34 @@ export class LemmyHttp {
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Globally block an instance as admin.
|
||||
*
|
||||
* `HTTP.Post /admin/block_instance`
|
||||
*/
|
||||
adminBlockInstance(form: AdminBlockInstanceParams, options?: RequestOptions) {
|
||||
return this.#wrapper<AdminBlockInstanceParams, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/admin/block_instance",
|
||||
form,
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Globally allow an instance as admin.
|
||||
*
|
||||
* `HTTP.Post /admin/allow_instance`
|
||||
*/
|
||||
adminAllowInstance(form: AdminAllowInstanceParams, options?: RequestOptions) {
|
||||
return this.#wrapper<AdminAllowInstanceParams, SuccessResponse>(
|
||||
HttpType.Post,
|
||||
"/admin/allow_instance",
|
||||
form,
|
||||
options,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload an image to the server.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue