Skip to content

Conversation

@ArcaEge
Copy link
Collaborator

@ArcaEge ArcaEge commented Jan 3, 2026

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a payout system for reviewers, automatically awarding them 0.4 bricks when they perform review actions on projects in the 'submitted' status.

  • Adds a constant T1_PAYOUT_BRICKS (0.4) to define the payout amount
  • Extends the project query to include status information
  • Implements automatic brick payout logic for non-comment review actions on submitted projects

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/lib/defs.ts Adds the T1_PAYOUT_BRICKS constant defining the reviewer payout amount
src/routes/dashboard/admin/review/[id]/+page.server.ts Adds project status to query and implements payout logic that awards bricks to reviewers for non-comment actions on submitted projects

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

await db
.update(user)
.set({
brick: locals.user.brick + T1_PAYOUT_BRICKS
Copy link

Copilot AI Jan 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The payout logic uses a stale brick value from the session data. If the user's brick balance changes between when the session was loaded and when this update executes, those changes will be overwritten. Instead of using locals.user.brick + T1_PAYOUT_BRICKS, use SQL increment operations to ensure atomic updates.

Suggested change
brick: locals.user.brick + T1_PAYOUT_BRICKS
brick: sql`${user.brick} + ${T1_PAYOUT_BRICKS}`

Copilot uses AI. Check for mistakes.
@ArcaEge ArcaEge merged commit f629624 into main Jan 4, 2026
1 check passed
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.

3 participants