Skip to content

Commit

Permalink
Taxon rematching on new list item addition, fixed reindex endpoint for
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-brinkman committed Jul 18, 2024
1 parent 097c4e4 commit 4f1544f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,14 @@ public SpeciesListItem addSpeciesListItem(
// update last updated
updateLastUpdated(speciesListItem, principal);

// rematch taxonomy
try {
Classification classification = taxonService.lookupTaxon(speciesListItem);
speciesListItem.setClassification(classification);
} catch (Exception e) {
logger.error(e.getMessage(), e);
}

// index
reindex(speciesListItem, optionalSpeciesList.get());
return speciesListItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public ResponseEntity<Object> reindex(
ResponseEntity<Object> errorResponse = checkAuthorized(speciesListID, principal);
if (errorResponse != null) return errorResponse;

taxonService.taxonMatchDataset(speciesListID);
taxonService.reindex(speciesListID);
return new ResponseEntity<>(HttpStatus.OK);
} catch (Exception e) {
logger.error("Error while reindexing dataset " + e.getMessage(), e);
Expand Down

0 comments on commit 4f1544f

Please sign in to comment.