type Github = {
token: string;
};
/**
* Delete a release reaction
* **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`.
Delete a reaction to a [release](https://docs.github.com/rest/reference/repos#releases).
*/
export async function main(
auth: Github,
owner: string,
repo: string,
release_id: string,
reaction_id: string
) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/releases/${release_id}/reactions/${reaction_id}`
);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 367 days ago
type Github = {
token: string;
};
/**
* Delete a release reaction
* **Note:** You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`.
Delete a reaction to a [release](https://docs.github.com/rest/reference/repos#releases).
*/
export async function main(
auth: Github,
owner: string,
repo: string,
release_id: string,
reaction_id: string
) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/releases/${release_id}/reactions/${reaction_id}`
);
const response = await fetch(url, {
method: "DELETE",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.text();
}
Submitted by hugo697 927 days ago