feat: add v0.19.0 support

This commit is contained in:
Xyphyn committed 2023-09-28 17:09:09 -07:00
1 parent b3b8a10e44
commit 119ab53946
62 files changed
+188 -157

No files matched your search

-7
View File
@@ -70,7 +70,6 @@ export async function save(
if (item.type == 'post') {
return (
await getClient().savePost({
auth: jwt,
post_id: item.id,
save: save,
})
@@ -78,7 +77,6 @@ export async function save(
} else if (item.type == 'comment') {
return (
await getClient().saveComment({
auth: jwt,
comment_id: item.id,
save: save,
})
@@ -97,7 +95,6 @@ export async function deleteItem(
if (item.type == 'post') {
return (
await getClient().deletePost({
auth: jwt,
post_id: item.id,
deleted: deleted,
})
@@ -105,7 +102,6 @@ export async function deleteItem(
} else if (item.type == 'comment') {
return (
await getClient().deleteComment({
auth: jwt,
comment_id: item.id,
deleted: deleted,
})
@@ -124,7 +120,6 @@ export async function vote(
if (item.type == 'post') {
return (
await getClient().likePost({
auth: jwt,
post_id: item.id,
score: vote,
})
@@ -132,7 +127,6 @@ export async function vote(
} else if (item.type == 'comment') {
return (
await getClient().likeComment({
auth: jwt,
comment_id: item.id,
score: vote,
})
@@ -151,7 +145,6 @@ export async function markAsRead(
if (item.type == 'post') {
return (
await getClient().markPostAsRead({
auth: jwt,
post_id: item.id,
read: read,
})
-3
View File
@@ -10,7 +10,6 @@ export const blockUser = async (block: boolean, id: number) => {
if (!auth) throw new Error('Unauthorized')
const response = await getClient().blockPerson({
auth: auth,
block: block,
person_id: id,
})
@@ -53,14 +52,12 @@ export const addSubscription = (
export const addAdmin = async (handle: string, added: boolean, jwt: string) =>
trycatch(async () => {
const user = await getClient().resolveObject({
auth: jwt,
q: handle,
})
if (!user.person) throw new Error('No user found')
return await getClient().addAdmin({
auth: jwt,
added: true,
person_id: user.person.person.id,
})