fix bug when dmp has been deposited in a repository and that repository does not exist any more.

This commit is contained in:
Bernaldo Mihasi 2023-06-01 12:15:22 +03:00
parent 4bac942059
commit 730b60598a
1 changed files with 4 additions and 4 deletions

View File

@ -651,15 +651,15 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
} }
createDoiLink(doiModel: DoiModel): string { createDoiLink(doiModel: DoiModel): string {
const recordUrl = this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId).repositoryRecordUrl; const repository = this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId);
if(typeof recordUrl !== "undefined"){ if(typeof repository !== "undefined"){
if(doiModel.repositoryId == "Zenodo"){ if(doiModel.repositoryId == "Zenodo"){
const doiarr = doiModel.doi.split('.'); const doiarr = doiModel.doi.split('.');
const id = doiarr[doiarr.length - 1]; const id = doiarr[doiarr.length - 1];
return this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId).repositoryRecordUrl + id; return repository.repositoryRecordUrl + id;
} }
else{ else{
return this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId).repositoryRecordUrl + doiModel.doi; return repository.repositoryRecordUrl + doiModel.doi;
} }
} }
else{ else{