diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/ClientsApiResource.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/ClientsApiResource.java index fe75b8062..7615ce442 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/ClientsApiResource.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/ClientsApiResource.java @@ -62,6 +62,10 @@ public class ClientsApiResource { @Autowired private ApiJsonSerializerService apiJsonSerializerService; + private static final Set typicalResponseParameters = new HashSet( + Arrays.asList("id", "officeId", "officeName", "externalId", "firstname", "lastname", "joinedDate", "displayName", "clientOrBusinessName") + ); + @GET @Consumes({MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_JSON}) @@ -75,10 +79,6 @@ public class ClientsApiResource { final String extraCriteria = getClientCriteria(sqlSearch, officeId, externalId, displayName, firstName, lastName); - Set typicalResponseParameters = new HashSet( - Arrays.asList("id", "officeId", "officeName", "externalId", "firstname", "lastname", "joinedDate", "displayName") - ); - Set responseParameters = ApiParameterHelper.extractFieldsForResponseIfProvided(uriInfo.getQueryParameters()); if (responseParameters.isEmpty()) { responseParameters.addAll(typicalResponseParameters); @@ -137,10 +137,6 @@ public class ClientsApiResource { @PathParam("clientId") final Long clientId, @Context final UriInfo uriInfo) { - Set typicalResponseParameters = new HashSet( - Arrays.asList("id", "officeId", "officeName", "externalId", "firstname", "lastname", "joinedDate", "displayName") - ); - Set responseParameters = ApiParameterHelper.extractFieldsForResponseIfProvided(uriInfo.getQueryParameters()); if (responseParameters.isEmpty()) { responseParameters.addAll(typicalResponseParameters); @@ -163,13 +159,10 @@ public class ClientsApiResource { @Produces({MediaType.APPLICATION_JSON}) public String newClientDetails(@Context final UriInfo uriInfo) { - Set typicalResponseParameters = new HashSet( - Arrays.asList("id", "officeId", "officeName", "externalId", "firstname", "lastname", "joinedDate", "displayName", "allowedOffices") - ); - Set responseParameters = ApiParameterHelper.extractFieldsForResponseIfProvided(uriInfo.getQueryParameters()); if (responseParameters.isEmpty()) { responseParameters.addAll(typicalResponseParameters); + responseParameters.add("allowedOffices"); } boolean prettyPrint = ApiParameterHelper.prettyPrint(uriInfo.getQueryParameters()); diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/GoogleGsonApiJsonSerializerService.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/GoogleGsonApiJsonSerializerService.java index 5dc279f33..a2645599b 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/GoogleGsonApiJsonSerializerService.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/infrastructure/GoogleGsonApiJsonSerializerService.java @@ -85,7 +85,7 @@ public class GoogleGsonApiJsonSerializerService implements ApiJsonSerializerServ ); private static final Set CLIENT_DATA_PARAMETERS = new HashSet( - Arrays.asList("id", "officeId", "officeName", "externalId", "firstname", "lastname", "joinedDate", "displayName", "allowedOffices") + Arrays.asList("id", "officeId", "officeName", "externalId", "firstname", "lastname", "joinedDate", "displayName", "clientOrBusinessName", "allowedOffices") ); private static final Set CLIENT_ACCOUNTS_DATA_PARAMETERS = new HashSet(