Commit 7cee035a authored by Labros Papadopoulos's avatar Labros Papadopoulos
Browse files

check if it has geographic info

parent f7733648
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -82,6 +82,8 @@ export class EditIndividualsComponent implements OnInit {


  testbedProvider = false
  testbedProvider = false


  hasGeographicSite = false

  subscriptions = new Subscription()
  subscriptions = new Subscription()


  ngOnInit() {
  ngOnInit() {
@@ -98,6 +100,11 @@ export class EditIndividualsComponent implements OnInit {
            if (val ==='TESTBED_PROVIDER') {
            if (val ==='TESTBED_PROVIDER') {
              this.testbedProvider=true
              this.testbedProvider=true
              this.retrieveGeographicSite()
              this.retrieveGeographicSite()
              console.log(this.geographicSite)
              if (this.geographicSite.place[0].geographicAddress.city!==null){
                  this.hasGeographicSite=true
                  console.log(this.hasGeographicSite)
              }
              }
              }
          }
          }
      this.retrieveIndividual()
      this.retrieveIndividual()
@@ -309,7 +316,7 @@ export class EditIndividualsComponent implements OnInit {
    console.log(updateObj)
    console.log(updateObj)
    let updatedGeographicSite: GeographicSite
    let updatedGeographicSite: GeographicSite


    if (this.newIndividual) {
    if (!this.hasGeographicSite) {


      this.geographicSiteService.createGeographicSite(updateObj).subscribe(
      this.geographicSiteService.createGeographicSite(updateObj).subscribe(
        data => { updatedGeographicSite = data },
        data => { updatedGeographicSite = data },