Skip to content

Fix employee page disadvatages#268

Open
Boburm1rzo wants to merge 5 commits intointegrationfrom
Fix-employee-page-disadvatages
Open

Fix employee page disadvatages#268
Boburm1rzo wants to merge 5 commits intointegrationfrom
Fix-employee-page-disadvatages

Conversation

@Boburm1rzo
Copy link
Copy Markdown
Contributor

image

image

image

image

Comment on lines +104 to +117
[HttpGet]
public async Task<IActionResult> CheckUserName(string userName, int? id = null)
{
if (string.IsNullOrEmpty(userName))
{
return Json(new { isTaken = false });
}

var employees = await employeeStore.GetAsync();
var isTaken = employees.Any(x => x.UserName.ToLower() == userName.ToLower() && (id == null || x.Id != id));

return Json(new { isTaken });
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a very good change
and we should apply this in many cases ( phone number, passport, etc. )

@Ramadan1011 Ramadan1011 self-requested a review March 23, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants