feat: add ability to mark individual posts as read, close #114
This commit is contained in:
1 parent
0be27d8eee
commit
79221e2e53
3 files changed
+32
-3
No files matched your search
@@ -140,3 +140,22 @@ export async function vote(
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
export async function markAsRead(
|
||||
item: ContentView | Submission,
|
||||
read: boolean,
|
||||
jwt: string
|
||||
): Promise<boolean> {
|
||||
if (isSubmission(item)) item = contentItem(item)
|
||||
|
||||
if (item.type == 'post') {
|
||||
return (
|
||||
await getClient().markPostAsRead({
|
||||
auth: jwt,
|
||||
post_id: item.id,
|
||||
read: read,
|
||||
})
|
||||
).post_view.read
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in new issue
Block a user