From f0c7c4fe7ed4677479d90d8a8e4c893c555e0b9f Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 23 Nov 2022 10:06:05 +0100 Subject: [PATCH 1/2] fixed author update after creating candidate --- .../candidate-management-detail.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..2e62858b 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 @@ -239,7 +239,7 @@ export class CandidateManagementDetailComponent implements OnInit, AfterViewInit // call update for all additional authors for(let author of authorlist) { if(author.userId !== first_author) { - this.candidateManagementService.updateAuthorsCandidate(this.candidate, author).subscribe(result => { + this.candidateManagementService.updateAuthorsCandidate(result, author).subscribe(result => { this.candidate = result; }) } From 0644905743172f344f109a325281aacca61b04cf Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 24 Nov 2022 13:30:08 +0100 Subject: [PATCH 2/2] 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 2e62858b..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(result, 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() {