fix bug when dmp has been deposited in a repository and that repository does not exist any more.
This commit is contained in:
parent
4bac942059
commit
730b60598a
|
@ -651,15 +651,15 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
}
|
||||
|
||||
createDoiLink(doiModel: DoiModel): string {
|
||||
const recordUrl = this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId).repositoryRecordUrl;
|
||||
if(typeof recordUrl !== "undefined"){
|
||||
const repository = this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId);
|
||||
if(typeof repository !== "undefined"){
|
||||
if(doiModel.repositoryId == "Zenodo"){
|
||||
const doiarr = doiModel.doi.split('.');
|
||||
const id = doiarr[doiarr.length - 1];
|
||||
return this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId).repositoryRecordUrl + id;
|
||||
return repository.repositoryRecordUrl + id;
|
||||
}
|
||||
else{
|
||||
return this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId).repositoryRecordUrl + doiModel.doi;
|
||||
return repository.repositoryRecordUrl + doiModel.doi;
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
|
Loading…
Reference in New Issue