//native
type Supabase = {
key: string
}
/**
* Disables preview branching
* Disables preview branching for the specified project
*/
export async function main(auth: Supabase, ref: string) {
const url = new URL(`https://api.supabase.com/v1/projects/${ref}/branches`)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Bearer ' + auth.key
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 151 days ago