Skip to content

Commit

Permalink
fix: incorrect request for voting (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
diivi committed May 13, 2023
1 parent 99e0f0e commit 7a35014
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/fetchOpenSaucedApiData.ts
Expand Up @@ -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}` },
},
);
Expand Down

0 comments on commit 7a35014

Please sign in to comment.