Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
HIAST-Clinics
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
almohanad.hafez
HIAST-Clinics
Commits
b020fb22
Commit
b020fb22
authored
Aug 23, 2024
by
Almouhannad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(B) Change update user behavior
parent
6949ca50
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
UpdateDoctorUserHandler.cs
...sers/Commands/UpdateDoctorUser/UpdateDoctorUserHandler.cs
+16
-8
No files found.
Clinics.Backend/Application/Users/Commands/UpdateDoctorUser/UpdateDoctorUserHandler.cs
View file @
b020fb22
...
...
@@ -27,18 +27,26 @@ public class UpdateDoctorUserHandler : CommandHandlerBase<UpdateDoctorUserComman
#
endregion
#
region
2.
Check
unique
username
if
(
user
.
User
.
UserName
!=
request
.
UserName
)
// Unchanged user name, so just changing password
{
var
uniqueUserNameResult
=
await
_userRepository
.
IsUserNameAvailableAsunc
(
request
.
UserName
);
if
(
uniqueUserNameResult
.
IsFailure
)
return
Result
.
Failure
(
uniqueUserNameResult
.
Error
);
if
(
uniqueUserNameResult
.
Value
==
false
)
return
Result
.
Failure
(
IdentityErrors
.
TakenUserName
);
}
#
endregion
#
region
3.
change
username
if
(
user
.
User
.
UserName
!=
request
.
UserName
)
// Unchanged user name, so just changing password
{
var
updateUserNameResult
=
await
_userRepository
.
ChangeUserName
(
user
.
User
,
request
.
UserName
);
if
(
updateUserNameResult
.
IsFailure
)
return
Result
.
Failure
(
updateUserNameResult
.
Error
);
}
#
endregion
#
region
4.
Change
password
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment