added new metod for getting workshop on client login

This commit is contained in:
SamSys
2025-01-13 20:10:25 +03:30
parent dcda7b0bd0
commit 16b85676a2
3 changed files with 37 additions and 10 deletions

View File

@@ -246,15 +246,13 @@ public class AccountApplication : IAccountApplication
{
var clientPermissions = _accountPermissionSubtitle1Repository.GetAllPermissionCodes();
authViewModel.Permissions = clientPermissions;
var workshopList = _workshopRepository.SearchForClient(new WorkshopSearchModel() { AccountId = account.id })
.OrderByDescending(x => x.PersonnelCount).ToList().Select(x => new WorkshopClaim()
{
Slug = _passwordHasher.SlugHasher(x.Id),
Name = x.WorkshopFullName,
PersonnelCount = x.PersonnelCount,
Id = x.Id
}
).ToList();
var workshopList = _workshopRepository.GetWorkshopsByClientAccountId(account.id).Select(x => new WorkshopClaim
{
PersonnelCount = x.PersonnelCount,
Id = x.Id,
Name = x.WorkshopFullName,
Slug = _passwordHasher.SlugHasher(x.Id)
}).OrderByDescending(x => x.PersonnelCount).ToList();
authViewModel.WorkshopList = workshopList;
if (workshopList.Any())
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshopList.First().Id);