//native
/**
* Delete an environment variable from a project
* - To delete an environment variable you must have the project user permission
- You can't delete a BUILT_IN variable
- If you delete a variable having override or alias, the associated override/alias will be deleted as well
*/
export async function main(auth: RT.Qovery, projectId: string, environmentVariableId: string) {
const url = new URL(
`https://api.qovery.com/project/${projectId}/environmentVariable/${environmentVariableId}`
)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Token ' + 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