From 1eca37fc268eb77acda57f7213511eb94f12a6af Mon Sep 17 00:00:00 2001 From: Alexander Mandl <34032605+mhinkie@users.noreply.github.com> Date: Thu, 24 Nov 2022 13:34:19 +0100 Subject: [PATCH] Fixed author update after creating candidate (#168) * fixed author update after creating candidate * renamed results --- .../candidate-management-detail.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/candidate-management/candidate-management-detail/candidate-management-detail.component.ts b/src/app/candidate-management/candidate-management-detail/candidate-management-detail.component.ts index 57f4243a..7f159d00 100644 --- a/src/app/candidate-management/candidate-management-detail/candidate-management-detail.component.ts +++ b/src/app/candidate-management/candidate-management-detail/candidate-management-detail.component.ts @@ -235,18 +235,18 @@ export class CandidateManagementDetailComponent implements OnInit, AfterViewInit if (_user) first_author = _user.id; }) - this.candidateManagementService.createCandidate(this.candidate).subscribe(result => { - // call update for all additional authors + this.candidateManagementService.createCandidate(this.candidate).subscribe(createdCandidate => { + // call update for all additional authors using the newly created candidate for(let author of authorlist) { if(author.userId !== first_author) { - this.candidateManagementService.updateAuthorsCandidate(this.candidate, author).subscribe(result => { - this.candidate = result; - }) + this.candidateManagementService.updateAuthorsCandidate(createdCandidate, author).subscribe(updatedCandidate => { + this.candidate = updatedCandidate; + }); } } this.router.navigate(['./candidate/detail', this.candidate.name]); - }) + }); } update() {