Skip to content

Commit

Permalink
Fix - Correction de la récupération du user supprimé pour nettoyer se…
Browse files Browse the repository at this point in the history
…s données
  • Loading branch information
noelmugnier committed Oct 26, 2021
1 parent fb1ee44 commit 7b7d197
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public GenerateDeliveryBatchFormsCommandHandler(

public async Task<Result> Handle(GenerateDeliveryBatchFormsCommand request, CancellationToken token)
{
var deliveryBatch = await _context.DeliveryBatches.SingleAsync(d => d.Id == request.DeliveryBatchId, token);
var deliveryBatch = await _context.DeliveryBatches.SingleOrDefaultAsync(d => d.Id == request.DeliveryBatchId, token);
if (deliveryBatch == null)
return Result.Failure($"DeliveryBatch {request.DeliveryBatchId} was not found.");

var outputDocument = new PdfDocument();
Result<byte[]> blobResult = null;
Expand Down
2 changes: 1 addition & 1 deletion Sheaft.Mediatr/User/Commands/RemoveUserDataCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public RemoveUserDataCommandHandler(

public async Task<Result<string>> Handle(RemoveUserDataCommand request, CancellationToken token)
{
var entity = await _context.Users.FirstOrDefaultAsync(c => c.Id == request.UserId, token);
var entity = await _context.Users.IgnoreQueryFilters().SingleOrDefaultAsync(c => c.Id == request.UserId, token);
if (entity == null)
return Failure<string>("L'utilisateur est introuvable.");

Expand Down

0 comments on commit 7b7d197

Please sign in to comment.