diff --git a/src/content-scripts/components/RepoVoting/RepoVoteButton.ts b/src/content-scripts/components/RepoVoting/RepoVoteButton.ts index 70b8e0fe..a2bb43d7 100644 --- a/src/content-scripts/components/RepoVoting/RepoVoteButton.ts +++ b/src/content-scripts/components/RepoVoting/RepoVoteButton.ts @@ -20,7 +20,7 @@ export const VoteRepoButton = (ownerName: string, repoName: string) => { `; const userToken = await getAuthToken(); - const voted = await voteOrUnvoteRepo(userToken, ownerName, repoName, false); + const voted = await voteOrUnvoteRepo(userToken, ownerName, repoName, true); if (voted) { const unvoteRepoButton = RepoUnvoteButton(ownerName, repoName); diff --git a/src/utils/fetchOpenSaucedApiData.ts b/src/utils/fetchOpenSaucedApiData.ts index 2356ce47..28685fb1 100644 --- a/src/utils/fetchOpenSaucedApiData.ts +++ b/src/utils/fetchOpenSaucedApiData.ts @@ -92,7 +92,7 @@ export const voteOrUnvoteRepo = async (userToken: string, ownerName: string, rep const response = await fetch( `${OPEN_SAUCED_REPOS_ENDPOINT}/${ownerName}/${repoName}/vote`, { - method: vote ? "POST" : "DELETE", + method: vote ? "PUT" : "DELETE", headers: { Authorization: `Bearer ${userToken}` }, }, );