Adding ResolveObject to the API. Fixes #27

This commit is contained in:
Dessalines 2021-08-19 20:34:14 -04:00
parent 1ce122e4be
commit 5ef1a2d508
3 changed files with 19 additions and 0 deletions

View file

@ -56,6 +56,8 @@ import {
GetSiteConfig,
GetSiteConfigResponse,
GetSiteResponse,
ResolveObject,
ResolveObjectResponse,
SaveSiteConfig,
Search,
SearchResponse,
@ -152,6 +154,10 @@ export class LemmyHttp {
return this.wrapper(HttpType.Get, '/search', form);
}
async resolveObject(form: ResolveObject): Promise<ResolveObjectResponse> {
return this.wrapper(HttpType.Get, '/resolve_object', form);
}
async createCommunity(form: CreateCommunity): Promise<CommunityResponse> {
return this.wrapper(HttpType.Post, '/community', form);
}

View file

@ -128,3 +128,15 @@ export interface FederatedInstances {
allowed?: string[];
blocked?: string[];
}
export interface ResolveObject {
q: string;
auth?: string;
}
export interface ResolveObjectResponse {
comment?: CommentView;
post?: PostView;
community?: CommunityView;
person?: PersonViewSafe;
}

View file

@ -45,6 +45,7 @@ export enum UserOperation {
AddAdmin,
BanPerson,
Search,
ResolveObject,
MarkAllAsRead,
SaveUserSettings,
TransferCommunity,