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

View file

@ -92,6 +92,11 @@ export interface GetCommentsResponse {
comments: CommentView[];
}
export interface GetComment {
id: number;
auth?: string;
}
export interface CreateCommentReport {
comment_id: number;
reason: string;

View file

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

View file

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