diff --git a/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.ts b/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.ts index 337b3f993455a4539307c0fa25ce38ef7e26c9a9..be056a8eb2c9edf4a8865964e358a0041e7c31a5 100644 --- a/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.ts +++ b/src/app/shared/components/partyManagement/edit-individuals/edit-individuals.component.ts @@ -82,6 +82,8 @@ export class EditIndividualsComponent implements OnInit { testbedProvider = false + hasGeographicSite = false + subscriptions = new Subscription() ngOnInit() { @@ -98,6 +100,11 @@ export class EditIndividualsComponent implements OnInit { if (val ==='TESTBED_PROVIDER') { this.testbedProvider=true this.retrieveGeographicSite() + console.log(this.geographicSite) + if (this.geographicSite.place[0].geographicAddress.city!==null){ + this.hasGeographicSite=true + console.log(this.hasGeographicSite) + } } } this.retrieveIndividual() @@ -309,7 +316,7 @@ export class EditIndividualsComponent implements OnInit { console.log(updateObj) let updatedGeographicSite: GeographicSite - if (this.newIndividual) { + if (!this.hasGeographicSite) { this.geographicSiteService.createGeographicSite(updateObj).subscribe( data => { updatedGeographicSite = data },