From 3d2fdda7149b5ab55d92b21675a1027ce702b41b Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 27 Jun 2019 13:26:54 +0000 Subject: [PATCH] [Trunk | Admin]: affiliations.component: Bug fix: no check to make url tiny (call the function anyway). git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@56235 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../affiliations/affiliations.component.ts | 46 ++++++------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/src/app/pages/affiliations/affiliations.component.ts b/src/app/pages/affiliations/affiliations.component.ts index a763f24..0c23412 100644 --- a/src/app/pages/affiliations/affiliations.component.ts +++ b/src/app/pages/affiliations/affiliations.component.ts @@ -167,41 +167,25 @@ export class AffiliationsComponent implements OnInit { } addAffiliation() { - console.info(this.affiliation); if (!this.isEmptyAffiliation()) { + this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.logo_url).subscribe((logo_url)=> { + this.affiliation.logo_url = logo_url; - if(!HelperFunctions.isTiny(this.affiliation.logo_url)) { - this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.logo_url).subscribe((logo_url)=> { - this.affiliation.logo_url = logo_url; - - if(!HelperFunctions.isTiny(this.affiliation.website_url)) { - this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.website_url).subscribe((website_url) => { - this.affiliation.website_url = website_url; - if (!this.curatorAffiliations) { - this.updateCommunityAffiliations(this.index); - } else { - if (this.index === -1) { - this.affiliations.push(this.affiliation); - } else { - this.affiliations[this.index] = this.affiliation; - } - } - this.change(); - }); - } - }) - } else { - if(!this.curatorAffiliations) { - this.updateCommunityAffiliations(this.index); - } else { - if (this.index === -1) { - this.affiliations.push(this.affiliation); + this.utilitiesService.getTiny(this.properties.tinyUrl + this.affiliation.website_url).subscribe((website_url) => { + this.affiliation.website_url = website_url; + + if (!this.curatorAffiliations) { + this.updateCommunityAffiliations(this.index); } else { - this.affiliations[this.index] = this.affiliation; + if (this.index === -1) { + this.affiliations.push(this.affiliation); + } else { + this.affiliations[this.index] = this.affiliation; + } } - } - this.change(); - } + this.change(); + }); + }) } }