//native
type Xata = {
apiKey: string
}
/**
* Update workspace settings
* Update workspace settings
*/
export async function main(auth: Xata, workspace_id: string, body: {}) {
const url = new URL(`https://api.xata.io/workspaces/${workspace_id}/settings`)
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 428 days ago