diff --git a/grails-app/controllers/au/org/ala/specieslist/SpeciesListController.groovy b/grails-app/controllers/au/org/ala/specieslist/SpeciesListController.groovy index f19a9075..c74ca3b8 100644 --- a/grails-app/controllers/au/org/ala/specieslist/SpeciesListController.groovy +++ b/grails-app/controllers/au/org/ala/specieslist/SpeciesListController.groovy @@ -91,10 +91,10 @@ class SpeciesListController { if(sl){ helperService.deleteDataResourceForList(sl.dataResourceUid) List msIds = SpeciesListItem.executeQuery("select sli.matchedSpecies.id as id from SpeciesListItem as sli where dataResourceUid = :dataResourceUid", ["dataResourceUid": sl.dataResourceUid]) - MatchedSpecies.executeUpdate("delete from MatchedSpecies where id in (:msIds)", ["msIds": msIds]) - log.debug("Deleted matched species (${msIds.size()}) ") SpeciesListItem.executeUpdate("delete from SpeciesListItem where dataResourceUid = :dataResourceUid", ["dataResourceUid": sl.dataResourceUid]) log.debug("Deleted species in list: ${sl.dataResourceUid}") + MatchedSpecies.executeUpdate("delete from MatchedSpecies where id in (:msIds)", ["msIds": msIds]) + log.debug("Deleted matched species (${msIds.size()}) ") SpeciesListKVP.executeUpdate("delete from SpeciesListKVP where dataResourceUid = :dataResourceUid", ["dataResourceUid": sl.dataResourceUid]) log.debug("Deleted KV pairs in list: ${sl.dataResourceUid}") SpeciesList.executeUpdate("delete from SpeciesList where dataResourceUid = :dataResourceUid", ["dataResourceUid": sl.dataResourceUid])