mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-25 22:01:12 +00:00
Adding bannedpersons endpoint. (#41)
This commit is contained in:
parent
c4827a62c0
commit
e201e1c1b4
5 changed files with 28 additions and 1 deletions
11
src/http.ts
11
src/http.ts
|
@ -38,6 +38,7 @@ import {
|
|||
import {
|
||||
AddAdmin,
|
||||
AddAdminResponse,
|
||||
BannedPersonsResponse,
|
||||
BanPerson,
|
||||
BanPersonResponse,
|
||||
BlockPerson,
|
||||
|
@ -48,6 +49,7 @@ import {
|
|||
DeleteAccountResponse,
|
||||
DeletePrivateMessage,
|
||||
EditPrivateMessage,
|
||||
GetBannedPersons,
|
||||
GetCaptchaResponse,
|
||||
GetPersonDetails,
|
||||
GetPersonDetailsResponse,
|
||||
|
@ -584,6 +586,15 @@ export class LemmyHttp {
|
|||
return this.wrapper(HttpType.Post, "/user/ban", form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of banned users
|
||||
*/
|
||||
async getBannedPersons(
|
||||
form: GetBannedPersons
|
||||
): Promise<BannedPersonsResponse> {
|
||||
return this.wrapper(HttpType.Get, "/user/banned", form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Block a person.
|
||||
*/
|
||||
|
|
|
@ -315,3 +315,11 @@ export interface BlockPersonResponse {
|
|||
person_view: PersonViewSafe;
|
||||
blocked: boolean;
|
||||
}
|
||||
|
||||
export interface GetBannedPersons {
|
||||
auth: string;
|
||||
}
|
||||
|
||||
export interface BannedPersonsResponse {
|
||||
banned: PersonViewSafe[];
|
||||
}
|
||||
|
|
|
@ -131,7 +131,6 @@ export interface GetSiteResponse {
|
|||
*/
|
||||
site_view?: SiteView;
|
||||
admins: PersonViewSafe[];
|
||||
banned: PersonViewSafe[];
|
||||
online: number;
|
||||
version: string;
|
||||
/**
|
||||
|
|
|
@ -46,6 +46,7 @@ export enum UserOperation {
|
|||
ListRegistrationApplications,
|
||||
ApproveRegistrationApplication,
|
||||
BanPerson,
|
||||
GetBannedPersons,
|
||||
Search,
|
||||
ResolveObject,
|
||||
MarkAllAsRead,
|
||||
|
|
|
@ -33,6 +33,7 @@ import {
|
|||
DeleteAccount,
|
||||
DeletePrivateMessage,
|
||||
EditPrivateMessage,
|
||||
GetBannedPersons,
|
||||
GetPersonDetails,
|
||||
GetPersonMentions,
|
||||
GetPrivateMessages,
|
||||
|
@ -401,6 +402,13 @@ export class LemmyWebsocket {
|
|||
return wrapper(UserOperation.BanPerson, form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of banned users
|
||||
*/
|
||||
getBannedPersons(form: GetBannedPersons) {
|
||||
return wrapper(UserOperation.GetBannedPersons, form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an admin to your site.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue