Skip to content

Commit

Permalink
clean up logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fostermh committed Dec 1, 2023
1 parent d097675 commit b71ebbe
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/components/Tabs/IdentificationTab.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -216,21 +216,19 @@ const IdentificationTab = ({
updateRecord("doiCreationStatus")('')
}
else if (debouncedDoiIdValue) {
const doiUrl = debouncedDoiIdValue
if (doiUrl) {
let id = doiUrl
if (doiUrl.includes('doi.org/')) {
id = doiUrl.split('doi.org/').pop();
}
getDoiStatus({ doi: id, prefix: regionInfo.datacitePrefix })
.then(response => {
updateRecord("doiCreationStatus")(response.data)
})
.catch(err => {
console.error(err)
});
let id = debouncedDoiIdValue
if (debouncedDoiIdValue.includes('doi.org/')) {
id = debouncedDoiIdValue.split('doi.org/').pop();
}
getDoiStatus({ doi: id, prefix: regionInfo.datacitePrefix })
.then(response => {
updateRecord("doiCreationStatus")(response.data)
})
.catch(err => {
console.error(err)
});
}

return () => {
mounted.current = false;
};
Expand Down

0 comments on commit b71ebbe

Please sign in to comment.