This commit is contained in:
2021-03-30 22:48:59 +00:00
parent ea4462085a
commit c90e47c820
2 changed files with 9 additions and 5 deletions

View File

@@ -141,7 +141,7 @@ namespace AyaNova.Api.Controllers
case AyaType.WorkOrderItemTravel:
case AyaType.WorkOrderItemOutsideService:
case AyaType.WorkOrderItemUnit:
AyaTypeId TypeId = await WorkOrderBiz.GetAncestor(ayaType, id, ct);
AyaTypeId TypeId = new AyaTypeId(AyaType.WorkOrder, await WorkOrderBiz.GetWorkOrderIdFromDescendant(ayaType, id, ct));
return Ok(ApiOkResponse.Response(new { AyaType = TypeId.ATypeAsInt, Id = TypeId.ObjectId }));
default:
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_INVALID_VALUE, null, "Only types with ancestors are valid"));