Don't create responses from web interface
This commit is contained in:
parent
3596e9160d
commit
39520a9acc
1 changed files with 18 additions and 16 deletions
|
@ -217,17 +217,18 @@ func (model *Participant) Create(db *Database, args map[string]string, w http.Re
|
|||
return nil, err
|
||||
}
|
||||
|
||||
var response Response
|
||||
// FIXME: Should be managed by API
|
||||
// var response Response
|
||||
|
||||
if err := db._db.First(&response, &Response{ParticipantID: participant.ID}).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// if err := db._db.First(&response, &Response{ParticipantID: participant.ID}).Error; err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
|
||||
response.UserModifierCreate = NewUserModifierCreate(db, r)
|
||||
// response.UserModifierCreate = NewUserModifierCreate(db, r)
|
||||
|
||||
if err := db._db.Save(&response).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// if err := db._db.Save(&response).Error; err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
|
||||
return participant, nil
|
||||
}
|
||||
|
@ -378,17 +379,18 @@ func (model *Participant) Update(db *Database, args map[string]string, w http.Re
|
|||
return nil, err
|
||||
}
|
||||
|
||||
var response Response
|
||||
// FIXME: Should be managed by API
|
||||
// var response Response
|
||||
|
||||
if err := db._db.First(&response, &Response{ParticipantID: participant.(*Participant).ID}).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// if err := db._db.First(&response, &Response{ParticipantID: participant.(*Participant).ID}).Error; err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
|
||||
response.UserModifierUpdate = NewUserModifierUpdate(db, r)
|
||||
// response.UserModifierUpdate = NewUserModifierUpdate(db, r)
|
||||
|
||||
if err := db._db.Save(&response).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// if err := db._db.Save(&response).Error; err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
|
||||
return participant.(*Participant), nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue