Skip to content

Commit

Permalink
adjust likes create because there's a isLike param
Browse files Browse the repository at this point in the history
  • Loading branch information
boyangwang committed Jul 12, 2023
1 parent cf005ac commit e531ac7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/likes/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default allowCors(async function handler(
request: VercelRequest,
response: VercelResponse,
) {
await kv.hincrby("likes", request.body, 1);
await kv.hincrby("likes", request.body.articleId, request.body.like ? 1 : -1);
const likes = await kv.hgetall("likes");
response.status(200).json({
body: request.body,
Expand Down

0 comments on commit e531ac7

Please sign in to comment.