reactions

This commit is contained in:
john 2025-05-28 22:05:51 +02:00
parent 48e7094c5e
commit c21e193fbf
9 changed files with 97 additions and 119 deletions

View file

@ -60,31 +60,23 @@ export class PostsService {
}
async addReaction(postId: string, emoji: string): Promise<void> {
const response = await this.client.POST('/posts/{postId}/reactions', {
await this.client.POST('/posts/{postId}/reactions', {
params: {
path: { postId }
path: { postId },
},
body: { emoji },
credentials: 'include',
})
if (!response.data) {
throw new Error('Failed to add reaction')
}
}
async removeReaction(postId: string, emoji: string): Promise<void> {
const response = await this.client.DELETE('/posts/{postId}/reactions', {
await this.client.DELETE('/posts/{postId}/reactions', {
params: {
path: { postId }
path: { postId },
},
body: { emoji },
credentials: 'include',
})
if (!response.data) {
throw new Error('Failed to remove reaction')
}
}
}