Skip to content

Commit ef57ce8

Browse files
authored
Merge pull request #252 from swamphacks/hotfix/decisions-hotfixes
fix:what was i thinking
2 parents 27fe67d + 50fe36f commit ef57ce8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

apps/api/internal/bat/engine.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,21 @@ func (b *BatEngine) GroupCandidates(admissionsData []AdmissionCandidate) ([]Team
141141

142142
// Sort admissions candidates on a valid TeamID
143143
for _, app := range admissionsData {
144-
if app.TeamID.Valid && len(teamMap[app.TeamID.UUID]) > 1 {
144+
if app.TeamID.Valid {
145145
teamMap[app.TeamID.UUID] = append(teamMap[app.TeamID.UUID], app)
146146
} else {
147147
individualCandidates = append(individualCandidates, app)
148148
}
149149
}
150150

151+
// Check for teams with only one member and move them to individualCandidates
152+
for teamID, candidates := range teamMap {
153+
if len(candidates) == 1 {
154+
individualCandidates = append(individualCandidates, candidates[0])
155+
delete(teamMap, teamID)
156+
}
157+
}
158+
151159
teamsEvalData := make([]TeamEvaluationData, 0)
152160
for teamId, members := range teamMap {
153161
var totalScore float64

0 commit comments

Comments
 (0)