Implement custom account field deletion
Custom account fields can now be deleted either one at a time via id or all fields owned by an account
This commit is contained in:
parent
487b57b4d6
commit
cea3009641
1 changed files with 13 additions and 0 deletions
|
@ -55,3 +55,16 @@ func (s *Storage) AddNewUserField(name, value, belongsToId string) (*UserInfoFie
|
||||||
// TODO: Implement me
|
// TODO: Implement me
|
||||||
panic("Not implemented")
|
panic("Not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Storage) DeleteUserField(id uint) error {
|
||||||
|
defer util.Untrace(util.Trace(&log.Logger))
|
||||||
|
return s.db.Delete(UserInfoField{Model: gorm.Model{ID: id}}).Error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *Storage) DeleteAllUserFieldsForAccountId(id string) error {
|
||||||
|
defer util.Untrace(util.Trace(&log.Logger))
|
||||||
|
return s.db.Model(&UserInfoField{}).
|
||||||
|
Where(&UserInfoField{BelongsTo: id}).
|
||||||
|
Delete(&UserInfoField{}).
|
||||||
|
Error
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue