feat: add post hiding
This commit is contained in:
1 parent
dae4f1fe73
commit
ac3222d987
12 files changed
+69
-12
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { getInstance } from '$lib/lemmy.js'
|
||||
import { client, getInstance } from '$lib/lemmy.js'
|
||||
import type { View } from '$lib/settings'
|
||||
import { isImage, isVideo } from '$lib/ui/image'
|
||||
import { findClosestNumber } from '$lib/util'
|
||||
@@ -74,3 +74,16 @@ export const iframeType = (post: Post): IframeType => {
|
||||
if (isYoutubeLink(post.url)) return 'youtube'
|
||||
return 'none'
|
||||
}
|
||||
|
||||
export async function hidePost(
|
||||
id: number,
|
||||
hide: boolean,
|
||||
jwt: string
|
||||
): Promise<boolean> {
|
||||
const res = await client({ auth: jwt }).hidePost({
|
||||
hide: hide,
|
||||
post_ids: [id],
|
||||
})
|
||||
|
||||
return hide
|
||||
}
|
||||
Reference in new issue
Block a user