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 Diff line number Diff line
@@ -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 },