diff --git a/storage/userInfoFields.go b/storage/userInfoFields.go index 4eed6ec..5bc349a 100644 --- a/storage/userInfoFields.go +++ b/storage/userInfoFields.go @@ -55,3 +55,16 @@ func (s *Storage) AddNewUserField(name, value, belongsToId string) (*UserInfoFie // TODO: Implement me 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 +}