Skip to content

Commit

Permalink
Merge pull request #12150 from shnrndk/businessplanissue
Browse files Browse the repository at this point in the history
Duplicate app already exists exception message added
  • Loading branch information
tharikaGitHub authored Nov 2, 2023
2 parents 120df38 + f86edc1 commit dc4d5da
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,13 @@ public Response applicationsApplicationIdPut(String applicationId, ApplicationDT
if (!RestAPIStoreUtils.isUserOwnerOfApplication(oldApplication)) {
RestApiUtil.handleAuthorizationFailure(RestApiConstants.RESOURCE_APPLICATION, applicationId, log);
}

if (body.getName() != null && !body.getName().equalsIgnoreCase(oldApplication.getName())) {
if (APIUtil.isApplicationExist(username, body.getName(),
oldApplication.getGroupId(), oldApplication.getOrganization())) {
APIUtil.handleResourceAlreadyExistsException(
"A duplicate application already exists by the name - " + body.getName());
}
}
Application updatedApplication = preProcessAndUpdateApplication(username, body, oldApplication,
applicationId);
ApplicationDTO updatedApplicationDTO = ApplicationMappingUtil.fromApplicationtoDTO(updatedApplication);
Expand Down

0 comments on commit dc4d5da

Please sign in to comment.