type Github = {
token: string;
};
/**
* Delete an issue reaction
* **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.
Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/).
*/
export async function main(
auth: Github,
owner: string,
repo: string,
issue_number: string,
reaction_id: string
) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/issues/${issue_number}/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 an issue reaction
* **Note:** You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.
Delete a reaction to an [issue](https://docs.github.com/rest/reference/issues/).
*/
export async function main(
auth: Github,
owner: string,
repo: string,
issue_number: string,
reaction_id: string
) {
const url = new URL(
`https://api.github.com/repos/${owner}/${repo}/issues/${issue_number}/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