tentative campaign map management
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michele 2021-08-30 23:30:04 +01:00
parent c46e66595b
commit 4c345bd044
37 changed files with 1693 additions and 50 deletions

View file

@ -28,10 +28,10 @@ namespace Sledgemapper.Api.Handlers
{
var user = await _dbcontext.Users.FindAsync(command.UserId);
_dbcontext.Attach(user);
var campaigns = _dbcontext.Campaigns.Include(c => c.InvitedUsers).Include(c => c.Owner).Where(campaign => campaign.OwnerId == command.UserId || campaign.InvitedUsers.Contains(user));
var campaigns = _dbcontext.Campaigns.Include(c => c.InvitedUsers).Include(c => c.Maps).Include(c => c.Owner).Where(campaign => campaign.OwnerId == command.UserId || campaign.InvitedUsers.Contains(user));
return campaigns.
Select(c => new Shared.Entities.Campaign { Id = c.CampaignId, Name = c.CampaignName, Maps = c.Maps.Select(m => new Shared.Entities.Map { SessionName = m.MapName }).ToList()})
Select(c => new Shared.Entities.Campaign { Id = c.CampaignId, Name = c.CampaignName, Maps = c.Maps.Select(m => new Shared.Entities.Map { SessionName = m.MapName }).ToList() })
.ToList();
}
catch (Exception ex)