Adding bannedpersons endpoint. (#41)

This commit is contained in:
Dessalines 2022-01-06 11:19:36 -05:00 committed by GitHub
parent c4827a62c0
commit e201e1c1b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 1 deletions

View file

@ -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.
*/

View file

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

View file

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

View file

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

View file

@ -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.
*/