//native
type Xata = {
apiKey: string
}
/**
* Deletes an invite
* This operation provides a way to cancel invites by deleting them. Already accepted invites cannot be deleted.
*/
export async function main(auth: Xata, workspace_id: string, invite_id: string) {
const url = new URL(`https://api.xata.io/workspaces/${workspace_id}/invites/${invite_id}`)
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