Fixes bug on fetching multiple instances of the same Organisations.
This commit is contained in:
parent
26147d0c9e
commit
e884153bf2
|
@ -26,12 +26,10 @@ import java.util.Map;
|
||||||
@RequestMapping(value = {"/api"})
|
@RequestMapping(value = {"/api"})
|
||||||
public class Organisations extends BaseController {
|
public class Organisations extends BaseController {
|
||||||
|
|
||||||
private OrganisationsExternalSourcesModel organisationsExternalSourcesModel;
|
|
||||||
private OrganisationsManager organisationsManager;
|
private OrganisationsManager organisationsManager;
|
||||||
@Autowired
|
@Autowired
|
||||||
public Organisations(ApiContext apiContext, OrganisationsExternalSourcesModel organisationsExternalSourcesModel, OrganisationsManager organisationsManager) {
|
public Organisations(ApiContext apiContext, OrganisationsManager organisationsManager) {
|
||||||
super(apiContext);
|
super(apiContext);
|
||||||
this.organisationsExternalSourcesModel = organisationsExternalSourcesModel;
|
|
||||||
this.organisationsManager = organisationsManager;
|
this.organisationsManager = organisationsManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +39,7 @@ public class Organisations extends BaseController {
|
||||||
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type
|
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type
|
||||||
) throws HugeResultSet, NoURLFound {
|
) throws HugeResultSet, NoURLFound {
|
||||||
List<Map<String, String>> remoteRepos = this.getApiContext().getOperationsContext().getRemoteFetcher().getOrganisations(query, type);
|
List<Map<String, String>> remoteRepos = this.getApiContext().getOperationsContext().getRemoteFetcher().getOrganisations(query, type);
|
||||||
OrganisationsExternalSourcesModel organisationsExternalSourcesModel = this.organisationsExternalSourcesModel.fromExternalItem(remoteRepos);
|
OrganisationsExternalSourcesModel organisationsExternalSourcesModel = new OrganisationsExternalSourcesModel().fromExternalItem(remoteRepos);
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<OrganisationsExternalSourcesModel>().payload(organisationsExternalSourcesModel).status(ApiMessageCode.NO_MESSAGE));
|
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<OrganisationsExternalSourcesModel>().payload(organisationsExternalSourcesModel).status(ApiMessageCode.NO_MESSAGE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue