diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-15 13:19:21 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-15 13:19:21 -0600 |
commit | 9a6df95adecaf3935fdbd58d893fca6489a040b9 (patch) | |
tree | 55715a9903d276315279be837af5ecabaa98fe41 /src/state/lib/api.ts | |
parent | 60c72087ff0bc13453d2a1602b92b41baf1c2a6a (diff) | |
download | voidsky-9a6df95adecaf3935fdbd58d893fca6489a040b9.tar.zst |
Switch to using setVote()
Diffstat (limited to 'src/state/lib/api.ts')
-rw-r--r-- | src/state/lib/api.ts | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/state/lib/api.ts b/src/state/lib/api.ts index 807f257a9..ba2fcd3bb 100644 --- a/src/state/lib/api.ts +++ b/src/state/lib/api.ts @@ -51,48 +51,6 @@ export async function post( ) } -export async function upvote(store: RootStoreModel, uri: string, cid: string) { - return await store.api.app.bsky.feed.vote.create( - {did: store.me.did || ''}, - { - subject: {uri, cid}, - direction: 'up', - createdAt: new Date().toISOString(), - }, - ) -} - -export async function unupvote(store: RootStoreModel, upvoteUri: string) { - const urip = new AtUri(upvoteUri) - return await store.api.app.bsky.feed.vote.delete({ - did: urip.hostname, - rkey: urip.rkey, - }) -} - -export async function downvote( - store: RootStoreModel, - uri: string, - cid: string, -) { - return await store.api.app.bsky.feed.vote.create( - {did: store.me.did || ''}, - { - subject: {uri, cid}, - direction: 'down', - createdAt: new Date().toISOString(), - }, - ) -} - -export async function undownvote(store: RootStoreModel, downvoteUri: string) { - const urip = new AtUri(downvoteUri) - return await store.api.app.bsky.feed.vote.delete({ - did: urip.hostname, - rkey: urip.rkey, - }) -} - export async function repost(store: RootStoreModel, uri: string, cid: string) { return await store.api.app.bsky.feed.repost.create( {did: store.me.did || ''}, |