Delete Reaction
One script reply has been approved by the moderators Verified

Deletes the reaction with the given ID.

Created by hugo697 366 days ago
Submitted by hugo697 Bun
Verified 366 days ago
1
//native
2
type Beamer = {
3
	apiKey: string
4
}
5

6
export async function main(resource: Beamer, postId: string, reactionId: string) {
7
	const endpoint = `https://api.getbeamer.com/v0/posts/${postId}/reactions/${reactionId}`
8

9
	const response = await fetch(endpoint, {
10
		method: 'DELETE',
11
		headers: {
12
			'Beamer-Api-Key': resource.apiKey
13
		}
14
	})
15

16
	if (!response.ok) {
17
		const text = await response.text()
18
		throw new Error(`${response.status} ${text}`)
19
	}
20

21
	return { success: true }
22
}
23