mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-01 01:59:55 +00:00
Add getComment to client (#111)
This commit is contained in:
parent
afea84aa8d
commit
533e222a0c
4 changed files with 28 additions and 0 deletions
14
src/http.ts
14
src/http.ts
|
@ -9,6 +9,7 @@ import {
|
||||||
CreateCommentReport,
|
CreateCommentReport,
|
||||||
DeleteComment,
|
DeleteComment,
|
||||||
EditComment,
|
EditComment,
|
||||||
|
GetComment,
|
||||||
GetComments,
|
GetComments,
|
||||||
GetCommentsResponse,
|
GetCommentsResponse,
|
||||||
ListCommentReports,
|
ListCommentReports,
|
||||||
|
@ -673,6 +674,19 @@ export class LemmyHttp {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get / fetch comment.
|
||||||
|
*
|
||||||
|
* `HTTP.GET /comment`
|
||||||
|
*/
|
||||||
|
getComment(form: GetComment) {
|
||||||
|
return this.wrapper<GetComment, CommentResponse>(
|
||||||
|
HttpType.Get,
|
||||||
|
"/comment",
|
||||||
|
form
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Report a comment.
|
* Report a comment.
|
||||||
*
|
*
|
||||||
|
|
|
@ -92,6 +92,11 @@ export interface GetCommentsResponse {
|
||||||
comments: CommentView[];
|
comments: CommentView[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GetComment {
|
||||||
|
id: number;
|
||||||
|
auth?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface CreateCommentReport {
|
export interface CreateCommentReport {
|
||||||
comment_id: number;
|
comment_id: number;
|
||||||
reason: string;
|
reason: string;
|
||||||
|
|
|
@ -67,6 +67,7 @@ export enum UserOperation {
|
||||||
GetPrivateMessages,
|
GetPrivateMessages,
|
||||||
UserJoin,
|
UserJoin,
|
||||||
GetComments,
|
GetComments,
|
||||||
|
GetComment,
|
||||||
PostJoin,
|
PostJoin,
|
||||||
CommunityJoin,
|
CommunityJoin,
|
||||||
ChangePassword,
|
ChangePassword,
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {
|
||||||
CreateCommentReport,
|
CreateCommentReport,
|
||||||
DeleteComment,
|
DeleteComment,
|
||||||
EditComment,
|
EditComment,
|
||||||
|
GetComment,
|
||||||
GetComments,
|
GetComments,
|
||||||
ListCommentReports,
|
ListCommentReports,
|
||||||
RemoveComment,
|
RemoveComment,
|
||||||
|
@ -301,6 +302,13 @@ export class LemmyWebsocket {
|
||||||
return wrapper(UserOperation.GetComments, form);
|
return wrapper(UserOperation.GetComments, form);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get / fetch comment.
|
||||||
|
*/
|
||||||
|
getComment(form: GetComment) {
|
||||||
|
return wrapper(UserOperation.GetComment, form);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Like / vote on a post.
|
* Like / vote on a post.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue