From d665b8d213190da4c533da6f0d0a0a72cf969332 Mon Sep 17 00:00:00 2001 From: dulith Date: Thu, 21 Sep 2023 14:52:07 +0530 Subject: [PATCH] Add business info to search result DTOs for publisher portal & dev portal --- .../org/wso2/carbon/apimgt/impl/APIProviderImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java index 74bbaa33b8a8..5d0342dd06de 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java @@ -841,6 +841,14 @@ public API updateAPI(API api, API existingAPI) throws APIManagementException { apiLogObject.put(APIConstants.AuditLogConstants.CONTEXT, api.getContext()); apiLogObject.put(APIConstants.AuditLogConstants.VERSION, api.getId().getVersion()); apiLogObject.put(APIConstants.AuditLogConstants.PROVIDER, api.getId().getProviderName()); + try { + api.setCreatedTime(existingAPI.getCreatedTime()); + apiPersistenceInstance.updateAPI(new Organization(organization), APIMapper.INSTANCE.toPublisherApi(api)); + } catch (APIPersistenceException e) { + throw new APIManagementException("Error while updating API details", e); + } + APIUtil.logAuditMessage(APIConstants.AuditLogConstants.API, apiLogObject.toString(), + APIConstants.AuditLogConstants.UPDATED, this.username); //Validate Transports validateAndSetTransports(api); @@ -851,8 +859,7 @@ public API updateAPI(API api, API existingAPI) throws APIManagementException { } catch (APIPersistenceException e) { throw new APIManagementException("Error while updating API details", e); } - APIUtil.logAuditMessage(APIConstants.AuditLogConstants.API, apiLogObject.toString(), - APIConstants.AuditLogConstants.UPDATED, this.username); + //notify key manager with API update registerOrUpdateResourceInKeyManager(api, tenantDomain);