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
|
var parties []gin.H
|
||||||
partiesRows, err := h.db.QueryContext(ctx, `
|
if len(statusResp.Participants) > 0 {
|
||||||
SELECT party_id, party_index
|
for _, p := range statusResp.Participants {
|
||||||
FROM participants
|
parties = append(parties, gin.H{
|
||||||
WHERE session_id = $1
|
"party_id": p.PartyID,
|
||||||
ORDER BY party_index
|
"party_index": p.PartyIndex,
|
||||||
`, 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,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue