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 {
|
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{
|
||||||
|
|
Loading…
Reference in New Issue