feat(api): в JobUnitPreview добавлена обработка ситуации NoContent

This commit is contained in:
Mikhail Kuznetsov
2025-09-24 10:16:18 +10:00
parent 09f0f1e063
commit 6231f35236
2 changed files with 7 additions and 2 deletions

View File

@@ -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));