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:
hailin 2025-12-30 07:48:41 -08:00
parent ea66a3987e
commit ec7a25179d
1 changed files with 7 additions and 18 deletions

View File

@ -685,27 +685,16 @@ 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
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{ parties = append(parties, gin.H{
"party_id": partyID, "party_id": p.PartyID,
"party_index": partyIndex, "party_index": p.PartyIndex,
}) })
} }
} }
}
// Convert message_hash to hex string // Convert message_hash to hex string
messageHashHex := "" messageHashHex := ""