Skip to content

Commit

Permalink
Merge pull request #362 from cioos-siooc/336-ror-search-field-doesnt-…
Browse files Browse the repository at this point in the history
…always-populate-ror-url

336 ROR search field doesn't always populate ROR URL
  • Loading branch information
fostermh authored Jun 12, 2024
2 parents aece904 + de22f16 commit 34da207
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/FormComponents/ContactEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,15 @@ const ContactEditor = ({
) {
if (mounted.current) setRorSearchActive(false);
} else {
fetch(`https://api.ror.org/organizations?query=${newInputValue}`)
fetch(`https://api.ror.org/organizations?query="${newInputValue}"`)
.then((response) => response.json())
.then((response) => {if (mounted.current) setRorOptions(response.items)})
.then((response) => {
if (mounted.current){
setRorOptions(response.items)}
if (response.number_of_results === 1){
updateContactRor(response.items[0]);
}
})
.then(() => {if (mounted.current) setRorSearchActive(false)});
}
}
Expand Down

0 comments on commit 34da207

Please sign in to comment.