Move Ticket Name to the Participant model.
This commit is contained in:
parent
cc4dd76438
commit
2ff06bdb76
5 changed files with 20 additions and 18 deletions
|
|
@ -75,12 +75,13 @@ func (app *App) handlePublicSignup(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
// Update participant's personal details if they signed up with more info.
|
||||
if body.Phone != "" || body.Pronouns != "" {
|
||||
if body.Phone != "" || body.Pronouns != "" || body.TicketName != "" {
|
||||
app.db.Exec(`UPDATE participants SET
|
||||
phone = CASE WHEN phone = '' THEN ? ELSE phone END,
|
||||
pronouns = CASE WHEN pronouns = '' THEN ? ELSE pronouns END,
|
||||
phone = CASE WHEN phone = '' THEN ? ELSE phone END,
|
||||
pronouns = CASE WHEN pronouns = '' THEN ? ELSE pronouns END,
|
||||
ticket_name = CASE WHEN ticket_name = '' THEN ? ELSE ticket_name END,
|
||||
updated_at = ?
|
||||
WHERE id = ?`, body.Phone, body.Pronouns, now(), participant.ID)
|
||||
WHERE id = ?`, body.Phone, body.Pronouns, body.TicketName, now(), participant.ID)
|
||||
}
|
||||
|
||||
confirmToken, err := generateConfirmationToken()
|
||||
|
|
@ -93,7 +94,6 @@ func (app *App) handlePublicSignup(w http.ResponseWriter, r *http.Request) {
|
|||
ParticipantID: &participant.ID,
|
||||
Name: body.PreferredName,
|
||||
PreferredName: body.PreferredName,
|
||||
TicketName: body.TicketName,
|
||||
Email: body.Email,
|
||||
Phone: body.Phone,
|
||||
Pronouns: body.Pronouns,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue