Enhance draft structures in backend models by adding new fields for banned actions and audit logs. Update frontend API interfaces to accommodate nullable properties for drafts and results, ensuring better handling of optional data. Improve series adaptation logic to manage null values effectively.
This commit is contained in:
@@ -264,7 +264,7 @@ func NewMapDraft(pool []string, firstTeam string, teams [2]string) (*MapDraft, e
|
||||
if len(pool) < 1 || teams[0] == teams[1] || (firstTeam != teams[0] && firstTeam != teams[1]) {
|
||||
return nil, fmt.Errorf("%w: invalid map draft", ErrInvalid)
|
||||
}
|
||||
return &MapDraft{Pool: slices.Clone(pool), FirstTeamID: firstTeam, TeamIDs: teams}, nil
|
||||
return &MapDraft{Pool: slices.Clone(pool), Banned: []string{}, Actions: []DraftAction{}, FirstTeamID: firstTeam, TeamIDs: teams}, nil
|
||||
}
|
||||
|
||||
func (d *MapDraft) NextTeam() string {
|
||||
@@ -321,7 +321,7 @@ func NewHeroDraft(heroes []Hero, teams [2]string, first string, count int, previ
|
||||
if previous == nil {
|
||||
previous = map[string][]string{}
|
||||
}
|
||||
return &HeroDraft{Heroes: slices.Clone(heroes), TeamIDs: teams, FirstTeamID: first, BansPerTeam: count, SeriesBans: previous, CurrentRoles: map[string][]Role{}}, nil
|
||||
return &HeroDraft{Heroes: slices.Clone(heroes), TeamIDs: teams, FirstTeamID: first, BansPerTeam: count, SeriesBans: previous, CurrentBans: []DraftAction{}, CurrentRoles: map[string][]Role{}}, nil
|
||||
}
|
||||
|
||||
func (d *HeroDraft) NextTeam() string {
|
||||
|
||||
Reference in New Issue
Block a user