NTP-13111 : Skip user email updatation based on recent slack contract (#487)
This commit is contained in:
@@ -9,10 +9,6 @@ func UpdateUserFieldsIfChanged(existingUser *user.UserEntity, newUser *user.User
|
|||||||
existingUser.Name = newUser.Name
|
existingUser.Name = newUser.Name
|
||||||
isChanged = true
|
isChanged = true
|
||||||
}
|
}
|
||||||
if existingUser.Email != newUser.Email {
|
|
||||||
existingUser.Email = newUser.Email
|
|
||||||
isChanged = true
|
|
||||||
}
|
|
||||||
if existingUser.Image != newUser.Image {
|
if existingUser.Image != newUser.Image {
|
||||||
existingUser.Image = newUser.Image
|
existingUser.Image = newUser.Image
|
||||||
isChanged = true
|
isChanged = true
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ type UserDTO struct {
|
|||||||
|
|
||||||
func (entity *UserEntity) Update(user UserEntity) (UserEntity, bool) {
|
func (entity *UserEntity) Update(user UserEntity) (UserEntity, bool) {
|
||||||
setterFunctions := []func(UserEntity) bool{
|
setterFunctions := []func(UserEntity) bool{
|
||||||
entity.setNameIfNotEqual, entity.setEmailIfNotEqual, entity.setImageIfNotEqual,
|
entity.setNameIfNotEqual, entity.setImageIfNotEqual,
|
||||||
entity.setRealNameIfNotEqual, entity.setActiveIfNotEqual, entity.setIsBotIfNotEqual,
|
entity.setRealNameIfNotEqual, entity.setActiveIfNotEqual, entity.setIsBotIfNotEqual,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,14 +63,6 @@ func (entity *UserEntity) setNameIfNotEqual(user UserEntity) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (entity *UserEntity) setEmailIfNotEqual(user UserEntity) bool {
|
|
||||||
if entity.Email != user.Email {
|
|
||||||
entity.Email = user.Email
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func (entity *UserEntity) setImageIfNotEqual(user UserEntity) bool {
|
func (entity *UserEntity) setImageIfNotEqual(user UserEntity) bool {
|
||||||
if entity.Image != user.Image {
|
if entity.Image != user.Image {
|
||||||
entity.Image = user.Image
|
entity.Image = user.Image
|
||||||
|
|||||||
Reference in New Issue
Block a user