Skip to content

Commit 87ba4c2

Browse files
committed
Replace Update with Save in userAudit handling to avoid upsert behavior
1 parent 27f3a75 commit 87ba4c2

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

pkg/auth/user/UserService.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,10 +1664,7 @@ func (impl *UserServiceImpl) saveUserAudit(r *http.Request, userId int32) {
16641664
CreatedOn: time.Now(),
16651665
UpdatedOn: time.Now(),
16661666
}
1667-
// Using Update instead of Save to upsert (update if exists, insert if not)
1668-
// This prevents the user_audit table from filling up with duplicate entries
1669-
// for API token users
1670-
impl.userAuditService.Update(userAudit)
1667+
impl.userAuditService.Save(userAudit)
16711668
}
16721669

16731670
func (impl *UserServiceImpl) GetRoleFiltersByUserRoleGroups(userRoleGroups []userBean.UserRoleGroup) ([]userBean.RoleFilter, error) {

0 commit comments

Comments
 (0)