Auth optimization
This commit is contained in:
@@ -35,7 +35,8 @@ namespace FoodsharingSiegen.Server.Data.Service
|
||||
if (targetProspect == null) return new OperationResult<Interaction>(new Exception("Invalid prospect id"));
|
||||
|
||||
interaction.ProspectId = Guid.Empty;
|
||||
|
||||
interaction.Created = DateTime.UtcNow;
|
||||
|
||||
targetProspect.Interactions.Add(interaction);
|
||||
|
||||
await Context.SaveChangesAsync();
|
||||
@@ -111,7 +112,7 @@ namespace FoodsharingSiegen.Server.Data.Service
|
||||
{
|
||||
try
|
||||
{
|
||||
var prospects = await Context.Prospects.AsNoTracking().Include(x => x.Interactions).ThenInclude(x => x.User).OrderBy(x => x.Name).ToListAsync();
|
||||
var prospects = await Context.Prospects.AsNoTracking().Include(x => x.Interactions.OrderBy(i => i.Date)).ThenInclude(x => x.User).OrderBy(x => x.Name).ToListAsync();
|
||||
return new OperationResult<List<Prospect>>(prospects);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user