Last active
June 9, 2019 22:27
-
-
Save ktutnik/5d994fe19d14a101ab2e35c6ca996fe8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class UsersController { | |
| // --------- other methods removed for clarity | |
| @ownerOrAdmin() | |
| @route.put(":id") | |
| async modify(id: number, data: User) { | |
| const password = await bcrypt.hash(data.password, 10) | |
| return db("User").update({ ...data, password }).where({ id }) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment