refactor(account): use statusResp.Participants for parties in GetSignSessionByInviteCode
Same approach as keygen - get participants from session coordinator instead of querying database directly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ea66a3987e
commit
ec7a25179d
|
|
@ -685,25 +685,14 @@ func (h *CoManagedHTTPHandler) GetSignSessionByInviteCode(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
// Query participants for this session
|
||||
// Build parties from statusResp.Participants (same as keygen)
|
||||
var parties []gin.H
|
||||
partiesRows, err := h.db.QueryContext(ctx, `
|
||||
SELECT party_id, party_index
|
||||
FROM participants
|
||||
WHERE session_id = $1
|
||||
ORDER BY party_index
|
||||
`, sessionID)
|
||||
if err == nil {
|
||||
defer partiesRows.Close()
|
||||
for partiesRows.Next() {
|
||||
var partyID string
|
||||
var partyIndex int
|
||||
if err := partiesRows.Scan(&partyID, &partyIndex); err == nil {
|
||||
parties = append(parties, gin.H{
|
||||
"party_id": partyID,
|
||||
"party_index": partyIndex,
|
||||
})
|
||||
}
|
||||
if len(statusResp.Participants) > 0 {
|
||||
for _, p := range statusResp.Participants {
|
||||
parties = append(parties, gin.H{
|
||||
"party_id": p.PartyID,
|
||||
"party_index": p.PartyIndex,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue