Edits history of script submission #10612 for ' Delete Reaction (beamer)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    type Beamer = {
    	apiKey: string
    }
    
    export async function main(resource: Beamer, postId: string, reactionId: string) {
    	const endpoint = `https://api.getbeamer.com/v0/posts/${postId}/reactions/${reactionId}`
    
    	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 534 days ago