MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / awardBadge

Method awardBadge

server/src/db/community-db.ts:671–679  ·  view source on GitHub ↗
(userId: string, badgeId: string)

Source from the content-addressed store, hash-verified

669 }
670
671 async awardBadge(userId: string, badgeId: string): Promise<boolean> {
672 const result = await query(
673 `INSERT INTO user_badges (workos_user_id, badge_id)
674 VALUES ($1, $2)
675 ON CONFLICT (workos_user_id, badge_id) DO NOTHING`,
676 [userId, badgeId]
677 );
678 return (result.rowCount ?? 0) > 0;
679 }
680
681 /**
682 * Check badge thresholds and award any that have been earned.

Callers 1

tryAwardMethod · 0.95

Calls 1

queryFunction · 0.85

Tested by

no test coverage detected