set Code when inserting

This commit is contained in:
vilmibm 2023-03-09 06:39:20 +00:00
parent c43adc49fb
commit b789865943

View File

@ -32,7 +32,9 @@ func (i *Invite) Insert(db *sql.DB) error {
return err return err
} }
_, err = stmt.Exec(generateCode(i.Email), i.Email) i.Code = generateCode(i.Email)
_, err = stmt.Exec(i.Code, i.Email)
if err != nil { if err != nil {
return err return err
} }