Fix new version url

This commit is contained in:
Efstratios Giannopoulos 2023-12-11 15:15:03 +02:00
parent c048d7047f
commit e636baf4b8
1 changed files with 2 additions and 2 deletions

View File

@ -157,8 +157,8 @@ public class ZenodoDepositService implements RepositoryDeposit {
links = (LinkedHashMap<String, String>) createResponse.getOrDefault(ZENODO_LINKS, new LinkedHashMap<>());
//Second, make the new version (not in the links?)
if (!links.containsKey(ZENODO_LINKS_SELF)) throw new Exception("previousDOI not found");
String newVersionUrl = links.get(ZENODO_LINKS_SELF) + "/actions/newversion" + "?access_token=" + zenodoToken;
if (!links.containsKey(ZENODO_LINKS_LATEST_DRAFT)) throw new Exception("previousDOI not found");
String newVersionUrl = links.get(ZENODO_LINKS_LATEST_DRAFT) + "/actions/newversion" + "?access_token=" + zenodoToken;
logger.debug("new version url: " + newVersionUrl);
createResponse = zenodoClient.post().uri(newVersionUrl)
.bodyValue(null).exchangeToMono(mono -> mono.bodyToMono(new ParameterizedTypeReference<Map<String, LinkedHashMap<String, String>>>() {})).block();