Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: fix vote #437

Closed
wants to merge 2 commits into from
Closed

draft: fix vote #437

wants to merge 2 commits into from

Conversation

huai-jie
Copy link
Contributor

fix #427

export function newVoteProps(): Pick<Vote, "id" | "createdAt"> {
  return {
    id: crypto.randomUUID(),
    createdAt: new Date(),
  };
}
 const vote = {
    item,
    userLogin: user.login,
    ...newVoteProps(),
  };
  let status;
  switch (req.method) {
    case "DELETE":
      status = 204;
      await deleteVote(vote);
      break;

vote.id should not get from newVoteProps when undergoing the delete action

@huai-jie huai-jie marked this pull request as draft August 18, 2023 09:36
@iuioiua
Copy link
Contributor

iuioiua commented Aug 18, 2023

Thank you! Can you please run deno fmt and then deno task ok?

@iuioiua
Copy link
Contributor

iuioiua commented Aug 29, 2023

I'm closing this PR in favour of #445. Either way, thank you for your help @huai-jie! Feel free to take a look at that PR and tell me what you think.

@iuioiua iuioiua closed this Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vote count not working as expected
2 participants