diff --git a/server/AyaNova/Controllers/SearchController.cs b/server/AyaNova/Controllers/SearchController.cs index 31b3dd1f..ef834b50 100644 --- a/server/AyaNova/Controllers/SearchController.cs +++ b/server/AyaNova/Controllers/SearchController.cs @@ -159,6 +159,20 @@ namespace AyaNova.Api.Controllers AyaTypeId TypeId = new AyaTypeId(AyaType.Quote, (await QuoteBiz.GetQuoteIdFromRelativeAsync(ayaType, id, ct)).ParentId); return Ok(ApiOkResponse.Response(new { AyaType = TypeId.ATypeAsInt, Id = TypeId.ObjectId })); } + case AyaType.PMItem: + case AyaType.PMItemExpense: + case AyaType.PMItemLabor: + case AyaType.PMItemLoan: + case AyaType.PMItemPart: + case AyaType.PMItemScheduledUser: + case AyaType.PMItemTask: + case AyaType.PMItemTravel: + case AyaType.PMItemOutsideService: + case AyaType.PMItemUnit: + { + AyaTypeId TypeId = new AyaTypeId(AyaType.PM, (await PMBiz.GetPMIdFromRelativeAsync(ayaType, id, ct)).ParentId); + 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"));