Deletes an existing subscriber list.
1
type Acumbamail = {
2
authToken: string
3
}
4
5
export async function main(resource: Acumbamail, list_id: number) {
6
const endpoint = 'https://acumbamail.com/api/1/deleteList/'
7
8
const formData = new FormData()
9
10
formData.append('auth_token', resource.authToken)
11
formData.append('list_id', list_id.toString())
12
13
const response = await fetch(endpoint, {
14
method: 'POST',
15
headers: {
16
'Cache-Control': 'no-cache'
17
},
18
body: formData
19
})
20
21
if (!response.ok) {
22
throw new Error(`HTTP error! status: ${response.status}`)
23
24
25
return { success: true }
26
27