Delete a custom symbol source from a project.
1
//native
2
/**
3
* Delete a symbol source from a project
4
* Delete a custom symbol source from a project.
5
*/
6
export async function main(auth: RT.Sentry, project_id_or_slug: string, id: string | undefined) {
7
const url = new URL(
8
`https://${auth.region}.sentry.io/api/0/projects/${auth.organizationSlug}/${project_id_or_slug}/symbol-sources/`
9
)
10
for (const [k, v] of [['id', id]]) {
11
if (v !== undefined && v !== '') {
12
url.searchParams.append(k, v)
13
}
14
15
const response = await fetch(url, {
16
method: 'DELETE',
17
headers: {
18
Authorization: 'Bearer ' + auth.token
19
},
20
body: undefined
21
})
22
if (!response.ok) {
23
const text = await response.text()
24
throw new Error(`${response.status} ${text}`)
25
26
return await response.text()
27
28