//native
type Render = {
apiKey: string
}
/**
* Update project
* Update the details of a project.
To update the details of a particular _environment_ in the project, instead use the [Update environment](https://api-docs.render.com/reference/update-environment) endpoint.
*/
export async function main(auth: Render, projectId: string, body: { name?: string }) {
const url = new URL(`https://api.render.com/v1/projects/${projectId}`)
const response = await fetch(url, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.apiKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 235 days ago