Skip to content

Commit 1eca37f

Browse files
authored
Fixed author update after creating candidate (#168)
* fixed author update after creating candidate * renamed results
1 parent 20ca07c commit 1eca37f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/app/candidate-management/candidate-management-detail/candidate-management-detail.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,18 @@ export class CandidateManagementDetailComponent implements OnInit, AfterViewInit
235235
if (_user) first_author = _user.id;
236236
})
237237

238-
this.candidateManagementService.createCandidate(this.candidate).subscribe(result => {
239-
// call update for all additional authors
238+
this.candidateManagementService.createCandidate(this.candidate).subscribe(createdCandidate => {
239+
// call update for all additional authors using the newly created candidate
240240
for(let author of authorlist) {
241241
if(author.userId !== first_author) {
242-
this.candidateManagementService.updateAuthorsCandidate(this.candidate, author).subscribe(result => {
243-
this.candidate = result;
244-
})
242+
this.candidateManagementService.updateAuthorsCandidate(createdCandidate, author).subscribe(updatedCandidate => {
243+
this.candidate = updatedCandidate;
244+
});
245245
}
246246
}
247247

248248
this.router.navigate(['./candidate/detail', this.candidate.name]);
249-
})
249+
});
250250
}
251251

252252
update() {

0 commit comments

Comments
 (0)