Skip to content

57 like and dislike#71

Merged
sametekinpolat merged 8 commits intodevelopmentfrom
57-like-and-dislike
May 3, 2026
Merged

57 like and dislike#71
sametekinpolat merged 8 commits intodevelopmentfrom
57-like-and-dislike

Conversation

@sametekinpolat
Copy link
Copy Markdown
Owner

No description provided.

Adds two dedicated karma counters on the User model. The legacy
karmaScore field is kept for compatibility. DB pushed via prisma db push.
formatKarma: 999→"999", 1.2k, 15.4k, 1.5m with negative support.
slugify: converts post title to URL-safe underscore-separated slug.
… create

createPostAction now opens an interactive tx to write the initial
PostVote record (upvotes:1). votePostAction handles toggle-off,
direction-change, and new votes; updates postKarma on the author for
non-self-votes only (AC #58).
…reate

createCommentAction now uses an interactive tx to write the initial
CommentVote record (upvotes:1). voteCommentAction updates commentKarma
on the author for non-self-votes, mirroring the posts karma logic.
Adds votes sub-select to post query and postKarma+commentKarma to user
selects for both the post author and every comment author. Serializes
both to the client component.
Post vote column now wires to votePostAction with optimistic UI and
revert-on-error. Comment and post author names become Links to /u/
with a title tooltip showing formatted karma. Imports formatKarma.
Server component now passes currentUserId and per-post myVote from the
DB. CommunityPostCard gains local vote state wired to votePostAction.
AuthModal intercepts guest clicks.
Server component fetches user by username and passes postKarma /
commentKarma to UserProfileClient. Client shows total karma (formatted)
with a collapsible breakdown of Post Karma vs Comment Karma.
@sametekinpolat sametekinpolat linked an issue May 3, 2026 that may be closed by this pull request
@sametekinpolat sametekinpolat merged commit 290c01b into development May 3, 2026
1 check passed
@sametekinpolat sametekinpolat deleted the 57-like-and-dislike branch May 3, 2026 11:44
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.

Like and Dislike

1 participant