mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-01 01:59:55 +00:00
Add follow pending. (#52)
* Add follow pending. * v0.17.0-rc.1 * Make follower optional. * v0.17.0-rc.2 * Pending is now required. * v0.17.0-rc.3
This commit is contained in:
parent
dd615bf484
commit
57de18c17e
3 changed files with 13 additions and 1 deletions
|
@ -28,6 +28,7 @@ import {
|
|||
DeleteCommunity,
|
||||
EditCommunity,
|
||||
FollowCommunity,
|
||||
FollowCommunityResponse,
|
||||
GetCommunity,
|
||||
GetCommunityResponse,
|
||||
ListCommunities,
|
||||
|
@ -247,7 +248,9 @@ export class LemmyHttp {
|
|||
/**
|
||||
* Follow / subscribe to a community.
|
||||
*/
|
||||
async followCommunity(form: FollowCommunity): Promise<CommunityResponse> {
|
||||
async followCommunity(
|
||||
form: FollowCommunity
|
||||
): Promise<FollowCommunityResponse> {
|
||||
return this.wrapper(HttpType.Post, "/community/follow", form);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { ListingType, SortType } from "../others";
|
||||
import { Site } from "../source";
|
||||
import {
|
||||
CommunityFollowerView,
|
||||
CommunityModeratorView,
|
||||
CommunityView,
|
||||
PersonViewSafe,
|
||||
|
@ -39,6 +40,13 @@ export interface CommunityResponse {
|
|||
community_view: CommunityView;
|
||||
}
|
||||
|
||||
export interface FollowCommunityResponse {
|
||||
/**
|
||||
* An unfollow returns null.
|
||||
*/
|
||||
community_follower_view?: CommunityFollowerView;
|
||||
}
|
||||
|
||||
export interface ListCommunities {
|
||||
type_?: ListingType;
|
||||
sort?: SortType;
|
||||
|
|
|
@ -190,6 +190,7 @@ export interface ModStickyPostView {
|
|||
export interface CommunityFollowerView {
|
||||
community: CommunitySafe;
|
||||
follower: PersonSafe;
|
||||
pending: boolean;
|
||||
}
|
||||
|
||||
export interface CommunityBlockView {
|
||||
|
|
Loading…
Reference in a new issue