Adding mark post as read. Fixes #36
This commit is contained in:
parent
7203e3dce6
commit
d0fbcf2ec2
4 changed files with 27 additions and 0 deletions
|
@ -93,6 +93,7 @@ import {
|
|||
ListPostReports,
|
||||
ListPostReportsResponse,
|
||||
LockPost,
|
||||
MarkPostAsRead,
|
||||
PostReportResponse,
|
||||
PostResponse,
|
||||
RemovePost,
|
||||
|
@ -334,6 +335,14 @@ export class LemmyHttp {
|
|||
return this.wrapper(HttpType.Post, "/post/remove", form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark a post as read.
|
||||
* `HTTP.POST /post/mark_as_read`
|
||||
*/
|
||||
async markPostAsRead(form: MarkPostAsRead): Promise<PostResponse> {
|
||||
return this.wrapper(HttpType.Post, "/post/mark_as_read", form);
|
||||
}
|
||||
|
||||
/**
|
||||
* A moderator can lock a post ( IE disable new comments ).
|
||||
*/
|
||||
|
|
|
@ -95,6 +95,15 @@ export interface RemovePost {
|
|||
auth: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks a post as read.
|
||||
*/
|
||||
export interface MarkPostAsRead {
|
||||
post_id: number;
|
||||
read: boolean;
|
||||
auth: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Only admins and mods can lock a post.
|
||||
*/
|
||||
|
|
|
@ -26,6 +26,7 @@ export enum UserOperation {
|
|||
RemovePost,
|
||||
LockPost,
|
||||
StickyPost,
|
||||
MarkPostAsRead,
|
||||
SavePost,
|
||||
EditCommunity,
|
||||
DeleteCommunity,
|
||||
|
|
|
@ -61,6 +61,7 @@ import {
|
|||
GetSiteMetadata,
|
||||
ListPostReports,
|
||||
LockPost,
|
||||
MarkPostAsRead,
|
||||
RemovePost,
|
||||
ResolvePostReport,
|
||||
SavePost,
|
||||
|
@ -332,6 +333,13 @@ export class LemmyWebsocket {
|
|||
return wrapper(UserOperation.StickyPost, form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark a post as read.
|
||||
*/
|
||||
markPostAsRead(form: MarkPostAsRead) {
|
||||
return wrapper(UserOperation.MarkPostAsRead, form);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save a post.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue