//native
/**
* Delete a worker relation type
* Delete a worker relation type.
**Token scopes**: `organizations:write`
*/
export async function main(auth: RT.Deel, typeId: string) {
const url = new URL(`https://api.letsdeel.com/rest/v2/hris/worker_relations/types/${typeId}`)
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 235 days ago