Add getComment to client (#111)

This commit is contained in:
SleeplessOne1917 2023-04-12 23:48:54 +00:00 committed by GitHub
parent afea84aa8d
commit 533e222a0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 0 deletions

View file

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

View file

@ -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;

View file

@ -67,6 +67,7 @@ export enum UserOperation {
GetPrivateMessages, GetPrivateMessages,
UserJoin, UserJoin,
GetComments, GetComments,
GetComment,
PostJoin, PostJoin,
CommunityJoin, CommunityJoin,
ChangePassword, ChangePassword,

View file

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