Change status and password method #3
No reviewers
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Selly-Modules/usermngmt#3
Loading…
Reference in New Issue
No description provided.
Delete Branch "feature/changeStatus-password"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -48,10 +54,71 @@ func (s Service) UpdateByUserID(userID string, payload UpdateOptions) error {
}
ChangePasswordByUserID -> ChangeUserPassword
check
@ -48,10 +54,71 @@ func (s Service) UpdateByUserID(userID string, payload UpdateOptions) error {
}
đưa ra validate:
old or new password cannot be empty
user not found
ChangeUserStatus
user.Status == newStatus
thì return luôn ko cần làm gì nữamọi id client gửi qua đều phải validate lại
@ -48,10 +54,71 @@ func (s Service) UpdateByUserID(userID string, payload UpdateOptions) error {
}
done
@ -48,10 +54,71 @@ func (s Service) UpdateByUserID(userID string, payload UpdateOptions) error {
}
done
@ -48,10 +54,71 @@ func (s Service) UpdateByUserID(userID string, payload UpdateOptions) error {
}
done
@ -48,10 +54,71 @@ func (s Service) UpdateByUserID(userID string, payload UpdateOptions) error {
}
done
@ -48,10 +54,71 @@ func (s Service) UpdateByUserID(userID string, payload UpdateOptions) error {
}
done
@ -48,10 +54,71 @@ func (s Service) UpdateByUserID(userID string, payload UpdateOptions) error {
}
done
@ -48,10 +54,71 @@ func (s Service) UpdateByUserID(userID string, payload UpdateOptions) error {
}
done
@ -52,0 +58,4 @@
return err
}
return nil
cái này cũng move về dạng if như trên đi
chú ý mấy cái khác tương tự luôn, đưa về cách trên cho gọn code
@ -52,0 +58,4 @@
return err
}
return nil
done
check
@ -52,0 +58,4 @@
return err
}
return nil
fix như trên
@ -56,0 +107,4 @@
// Validate userID
id, isValid := mongodb.NewIDFromString(userID)
if !isValid {
return errors.New("invalid user id data")
chỗ này cũng check được như trên nè