//native
type Render = {
apiKey: string
}
/**
* Delete project
* Delete the project with the provided ID, along with all environments and services in that project.
**This operation is irreversible.** All services and other resources belonging to the project will be deleted.
*/
export async function main(auth: Render, projectId: string) {
const url = new URL(`https://api.render.com/v1/projects/${projectId}`)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 235 days ago