//native
type Webflow = {
token: string
}
export async function main(auth: Webflow, collection_id: string, field_id: string) {
const url = new URL(`https://api.webflow.com/v2/collections/${collection_id}/fields/${field_id}`)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Bearer ' + auth.token
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 255 days ago