unscoped delete
This commit is contained in:
@@ -120,7 +120,8 @@ func (u *User) Update(db *gorm.DB) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *User) Delete(db *gorm.DB) error {
|
func (u *User) Delete(db *gorm.DB) error {
|
||||||
return db.Delete(&User{}, "id = ?", u.ID).Error
|
return db.Unscoped().Delete(&User{}, "id = ?", u.ID).Error
|
||||||
|
// return db.Delete(&User{}, "id = ?", u.ID).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *User) FromID(db *gorm.DB, userID *uint) error {
|
func (u *User) FromID(db *gorm.DB, userID *uint) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user