fix: cast to user, no pointer
This commit is contained in:
parent
3b3faaa1e6
commit
1d60cbf532
|
@ -34,7 +34,7 @@ type User struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *User) BeforeUpdate(tx *gorm.DB) error {
|
func (u *User) BeforeUpdate(tx *gorm.DB) error {
|
||||||
dest := tx.Statement.Dest.(*User)
|
dest := tx.Statement.Dest.(User)
|
||||||
|
|
||||||
if tx.Statement.Changed("Email") {
|
if tx.Statement.Changed("Email") {
|
||||||
verify, err := getEmailVerfier().Verify(dest.Email)
|
verify, err := getEmailVerfier().Verify(dest.Email)
|
||||||
|
|
Loading…
Reference in New Issue