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"})
|
||||
public class Organisations extends BaseController {
|
||||
|
||||
private OrganisationsExternalSourcesModel organisationsExternalSourcesModel;
|
||||
private OrganisationsManager organisationsManager;
|
||||
@Autowired
|
||||
public Organisations(ApiContext apiContext, OrganisationsExternalSourcesModel organisationsExternalSourcesModel, OrganisationsManager organisationsManager) {
|
||||
public Organisations(ApiContext apiContext, OrganisationsManager organisationsManager) {
|
||||
super(apiContext);
|
||||
this.organisationsExternalSourcesModel = organisationsExternalSourcesModel;
|
||||
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
|
||||
) throws HugeResultSet, NoURLFound {
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue