Adding bannedpersons endpoint.

This commit is contained in:
Dessalines 2022-01-04 10:01:08 -05:00
parent c4827a62c0
commit fb4472f5f4
5 changed files with 28 additions and 1 deletions

View file

@ -38,6 +38,7 @@ import {
import { import {
AddAdmin, AddAdmin,
AddAdminResponse, AddAdminResponse,
BannedPersonsResponse,
BanPerson, BanPerson,
BanPersonResponse, BanPersonResponse,
BlockPerson, BlockPerson,
@ -48,6 +49,7 @@ import {
DeleteAccountResponse, DeleteAccountResponse,
DeletePrivateMessage, DeletePrivateMessage,
EditPrivateMessage, EditPrivateMessage,
GetBannedPersons,
GetCaptchaResponse, GetCaptchaResponse,
GetPersonDetails, GetPersonDetails,
GetPersonDetailsResponse, GetPersonDetailsResponse,
@ -584,6 +586,15 @@ export class LemmyHttp {
return this.wrapper(HttpType.Post, "/user/ban", form); 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. * Block a person.
*/ */

View file

@ -315,3 +315,11 @@ export interface BlockPersonResponse {
person_view: PersonViewSafe; person_view: PersonViewSafe;
blocked: boolean; blocked: boolean;
} }
export interface GetBannedPersons {
auth: string;
}
export interface BannedPersonsResponse {
banned: PersonViewSafe[];
}

View file

@ -131,7 +131,6 @@ export interface GetSiteResponse {
*/ */
site_view?: SiteView; site_view?: SiteView;
admins: PersonViewSafe[]; admins: PersonViewSafe[];
banned: PersonViewSafe[];
online: number; online: number;
version: string; version: string;
/** /**

View file

@ -46,6 +46,7 @@ export enum UserOperation {
ListRegistrationApplications, ListRegistrationApplications,
ApproveRegistrationApplication, ApproveRegistrationApplication,
BanPerson, BanPerson,
GetBannedPersons,
Search, Search,
ResolveObject, ResolveObject,
MarkAllAsRead, MarkAllAsRead,

View file

@ -33,6 +33,7 @@ import {
DeleteAccount, DeleteAccount,
DeletePrivateMessage, DeletePrivateMessage,
EditPrivateMessage, EditPrivateMessage,
GetBannedPersons,
GetPersonDetails, GetPersonDetails,
GetPersonMentions, GetPersonMentions,
GetPrivateMessages, GetPrivateMessages,
@ -401,6 +402,13 @@ export class LemmyWebsocket {
return wrapper(UserOperation.BanPerson, form); 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. * Add an admin to your site.
*/ */