Fetch all categories before updating participant
This commit is contained in:
parent
8ceb259ca8
commit
92a1f141a0
1 changed files with 7 additions and 0 deletions
|
@ -261,6 +261,13 @@ func (model *Participant) Update(args map[string]string, w http.ResponseWriter,
|
|||
participant.SelectedCategory = make(map[uint]string)
|
||||
participant.SelectedCategory[participant.CategoryID] = "selected"
|
||||
} else {
|
||||
if err := DB().Find(&participant.AllCategories).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
participant.SelectedCategory = make(map[uint]string)
|
||||
participant.SelectedCategory[participant.CategoryID] = "selected"
|
||||
|
||||
if err := DB().Find(&participant.AllContests).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue