mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-22 12:21:12 +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,
|
||||
DeleteComment,
|
||||
EditComment,
|
||||
GetComment,
|
||||
GetComments,
|
||||
GetCommentsResponse,
|
||||
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.
|
||||
*
|
||||
|
|
|
@ -92,6 +92,11 @@ export interface GetCommentsResponse {
|
|||
comments: CommentView[];
|
||||
}
|
||||
|
||||
export interface GetComment {
|
||||
id: number;
|
||||
auth?: string;
|
||||
}
|
||||
|
||||
export interface CreateCommentReport {
|
||||
comment_id: number;
|
||||
reason: string;
|
||||
|
|
|
@ -67,6 +67,7 @@ export enum UserOperation {
|
|||
GetPrivateMessages,
|
||||
UserJoin,
|
||||
GetComments,
|
||||
GetComment,
|
||||
PostJoin,
|
||||
CommunityJoin,
|
||||
ChangePassword,
|
||||
|
|
|
@ -4,6 +4,7 @@ import {
|
|||
CreateCommentReport,
|
||||
DeleteComment,
|
||||
EditComment,
|
||||
GetComment,
|
||||
GetComments,
|
||||
ListCommentReports,
|
||||
RemoveComment,
|
||||
|
@ -301,6 +302,13 @@ export class LemmyWebsocket {
|
|||
return wrapper(UserOperation.GetComments, form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get / fetch comment.
|
||||
*/
|
||||
getComment(form: GetComment) {
|
||||
return wrapper(UserOperation.GetComment, form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Like / vote on a post.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue