From 37967bc3fb51ccae2b44776766d49e07c26c0b52 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 5 Aug 2021 14:01:36 +0000 Subject: [PATCH] --- server/AyaNova/Controllers/SearchController.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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"));