Delete a goal comment.
1
//native
2
/**
3
* Delete Goal Comment
4
* Delete a goal comment.
5
*/
6
export async function main(
7
auth: RT.BambooHr,
8
employeeId: string,
9
goalId: string,
10
commentId: string
11
) {
12
const url = new URL(
13
`https://${auth.companyDomain}.bamboohr.com/api/v1/performance/employees/${employeeId}/goals/${goalId}/comments/${commentId}`
14
)
15
16
const response = await fetch(url, {
17
method: 'DELETE',
18
headers: {
19
Authorization: 'Basic ' + btoa(`${auth.apiKey}:x`)
20
},
21
body: undefined
22
})
23
if (!response.ok) {
24
const text = await response.text()
25
throw new Error(`${response.status} ${text}`)
26
}
27
return await response.json()
28
29