fix: update user-levels
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
7d77269acf
commit
946a97af2f
|
|
@ -133,9 +133,18 @@ func (_i *userLevelsRepository) Update(clientId *uuid.UUID, id uint, userLevels
|
|||
|
||||
delete(userLevelsMap, "id")
|
||||
|
||||
return _i.DB.DB.Model(&entity.UserLevels{}).
|
||||
// 🔥 HAPUS FIELD YANG NIL
|
||||
for k, v := range userLevelsMap {
|
||||
if v == nil {
|
||||
delete(userLevelsMap, k)
|
||||
}
|
||||
}
|
||||
|
||||
return _i.DB.DB.
|
||||
Model(&entity.UserLevels{}).
|
||||
Where("id = ?", id).
|
||||
Updates(userLevelsMap).Error
|
||||
Updates(userLevelsMap).
|
||||
Error
|
||||
// userLevelsMap, err := utilSvc.StructToMap(userLevels)
|
||||
// if err != nil {
|
||||
// return err
|
||||
|
|
|
|||
Loading…
Reference in New Issue