refactor(ReadHistoryQuery): update to not throw exception.
- update controller to throw NotFound if the list is empty
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user