File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
internal/sms-gateway/users Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ func Module() fx.Option {
1010 return fx .Module (
1111 "users" ,
1212 logger .WithNamedLogger ("users" ),
13+ fx .Provide (newRepository , fx .Private ),
1314 )
1415}
1516
Original file line number Diff line number Diff line change @@ -41,5 +41,11 @@ func (r *repository) Insert(user *User) error {
4141}
4242
4343func (r * repository ) UpdatePassword (ID string , passwordHash string ) error {
44- return r .db .Model ((* User )(nil )).Where ("id = ?" , ID ).Update ("password_hash" , passwordHash ).Error
44+ if err := r .db .Model ((* User )(nil )).
45+ Where ("id = ?" , ID ).
46+ Update ("password_hash" , passwordHash ).Error ; err != nil {
47+ return fmt .Errorf ("can't update password: %w" , err )
48+ }
49+
50+ return nil
4551}
You can’t perform that action at this time.
0 commit comments