//native
type Beamer = {
	apiKey: string
}
export async function main(resource: Beamer, postId: string, commentId: string) {
	const endpoint = `https://api.getbeamer.com/v0/posts/${postId}/comments/${commentId}`
	const response = await fetch(endpoint, {
		method: 'DELETE',
		headers: {
			'Beamer-Api-Key': resource.apiKey
		}
	})
	if (!response.ok) {
		const text = await response.text()
		throw new Error(`${response.status} ${text}`)
	}
	return { success: true }
}
 Submitted by hugo697 319 days ago