refactor(ReadHistoryQuery): update to not throw exception.

- update controller to throw NotFound if the list is empty
This commit is contained in:
Developer 02
2025-08-28 18:30:27 +02:00
parent f7c988be9b
commit dad43de8b1
5 changed files with 7 additions and 12 deletions

View File

@@ -42,10 +42,6 @@ public class ReadHistoryQueryHandler : IRequestHandler<ReadHistoryQuery, IEnumer
query = query.Where(h => h.Status == request.Status);
var hists = await query.ToListAsync(cancel);
if (hists.Count == 0)
return _mapper.Map<IEnumerable<EnvelopeHistoryDto>>(hists);
throw new NotFoundException();
return _mapper.Map<IEnumerable<EnvelopeHistoryDto>>(hists);
}
}