feat(api): в JobUnitPreview добавлена обработка ситуации NoContent
This commit is contained in:
@@ -12,6 +12,8 @@ using PARR.Constants;
|
||||
using PARR.DAL.DomainServices.Interfaces;
|
||||
using PARR.DAL.Models.Job;
|
||||
using PARR.DAL.Services.Interfaces.Unit;
|
||||
using static PARR.API.Contracts.V1.ApiRoutes;
|
||||
using Job = PARR.DAL.Models.Job.Job;
|
||||
|
||||
namespace PARR.API.Controllers.V1
|
||||
{
|
||||
@@ -68,6 +70,9 @@ namespace PARR.API.Controllers.V1
|
||||
|
||||
var units = await query.ToListAsync();
|
||||
|
||||
if (!units.Any())
|
||||
return NoContent();
|
||||
|
||||
var unitResponse = mapper.Map<List<UnitBaseResponse>>(units);
|
||||
|
||||
return Ok(new Response<List<UnitBaseResponse>>(unitResponse, true));
|
||||
|
||||
Reference in New Issue
Block a user