//native
type Xata = {
apiKey: string
}
/**
* Delete user
* Delete the user making the request
*/
export async function main(auth: Xata) {
const url = new URL(`https://api.xata.io/user`)
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 428 days ago