Guest User

Untitled

a guest
Nov 13th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. override fun update(id: String, paramsBody: User): User {
  2.  
  3. var currentUser = userRepository.findOne(id)
  4.  
  5. Preconditions.checkNotNull(paramsBody)
  6. RestPreconditions.checkFound(currentUser)
  7.  
  8. if(paramsBody.nama != null ) currentUser.nama = paramsBody.nama
  9. if(paramsBody.password != null ) currentUser.password = hashPassword(paramsBody.password.toString())
  10. if(paramsBody.jabatanId != null )currentUser.jabatanId = paramsBody.jabatanId
  11.  
  12. userRepository.save(currentUser)
  13.  
  14. return currentUser
  15. }
Add Comment
Please, Sign In to add comment