DEV Community

Discussion on: Creating JWT's and SignUp Route - Part[2/3] of Go Authentication series

Collapse
 
orlovssky profile image
Sanzhar A

Hello! Why did you add this snippet? i cannot find the usage

// AfterUpdate will update the Base struct after every update
func (base *Base) AfterUpdate(tx *gorm.DB) error {
// update timestamps
base.UpdatedAt = GenerateISOString()
return nil
}

Collapse
 
mdfaizan7 profile image
Faizan

This is to update the updatedAt field after every update on the database