type MailerLite = {
apiToken: string
}
export async function main(resource: MailerLite, groupId: string, subscriberId: string) {
const endpoint = `https://connect.mailerlite.com/api/subscribers/${subscriberId}/groups/${groupId}`
const response = await fetch(endpoint, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
Authorization: `Bearer ${resource.apiToken}`
}
})
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`)
}
return { success: true }
}
Submitted by hugo697 652 days ago