This commit is contained in:
2020-05-07 16:12:13 +00:00
parent 40093ec403
commit 75090ef06a

View File

@@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.JsonPatch;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using AyaNova.Models; using AyaNova.Models;
@@ -445,7 +444,9 @@ namespace AyaNova.Api.Controllers
var o = await biz.GetAsync(workOrderId, false); var o = await biz.GetAsync(workOrderId, false);
if (o == null) if (o == null)
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND)); return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
//Make sure the item exists first before getting into it
if (!o.WorkorderItems.Exists(m => m.Id == workOrderItemId))
return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));