Skip to content

Commit

Permalink
Merge pull request #12815 from NethmiRanasinghe/org_visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
chamilaadhi authored Jan 31, 2025
2 parents 7f72857 + a8c07a3 commit 8587622
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ public OrganizationDTO organizationId(String organizationId) {
}


@ApiModelProperty(example = "ece92bdc-e1e6-325c-b6f4-656208a041e9", required = true, value = "UUID of the organization. ")
@ApiModelProperty(example = "ece92bdc-e1e6-325c-b6f4-656208a041e9", value = "UUID of the organization. ")
@JsonProperty("organizationId")
@NotNull
public String getOrganizationId() {
return organizationId;
}
Expand All @@ -54,8 +53,9 @@ public OrganizationDTO externalOrganizationId(String externalOrganizationId) {
}


@ApiModelProperty(example = "ece92bdc-e1e6-325c-b6f4-656208a041e9", value = "External id of the organization. ")
@ApiModelProperty(example = "ece92bdc-e1e6-325c-b6f4-656208a041e9", required = true, value = "External id of the organization. ")
@JsonProperty("externalOrganizationId")
@NotNull
public String getExternalOrganizationId() {
return externalOrganizationId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ public Response organizationsPost(OrganizationDTO organizationDTO, MessageContex
orgId = orgInfo.getOrganizationId();
organizationDTO.setParentOrganizationId(orgId); // set current users organization as parent id if available.

Check warning on line 131 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/OrganizationsApiServiceImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/OrganizationsApiServiceImpl.java#L130-L131

Added lines #L130 - L131 were not covered by tests
}
if (organizationDTO.getParentOrganizationId() == null) {
throw new APIManagementException("Parent Organization not found",

Check warning on line 134 in components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/OrganizationsApiServiceImpl.java

View check run for this annotation

Codecov / codecov/patch

components/apimgt/org.wso2.carbon.apimgt.rest.api.admin.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/admin/v1/impl/OrganizationsApiServiceImpl.java#L134

Added line #L134 was not covered by tests
ExceptionCodes.MISSING_ORGANINATION);
}
OrganizationDetailsDTO orgDto = OrganizationsMappingUtil.toOrganizationDetailsDTO(organizationDTO);
orgDto.setTenantDomain(superOrganization);
orgDto = apiAdmin.addOrganization(orgDto);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4889,7 +4889,7 @@ components:
Organization:
title: Organization
required:
- organizationId
- externalOrganizationId
type: object
properties:
organizationId:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4889,7 +4889,7 @@ components:
Organization:
title: Organization
required:
- organizationId
- externalOrganizationId
type: object
properties:
organizationId:
Expand Down

0 comments on commit 8587622

Please sign in to comment.