//native
/**
* Delete a variable
* - To delete a variable
- 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, variableId: string) {
const url = new URL(`https://api.qovery.com/variable/${variableId}`)
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