Skip to content

Commit

Permalink
Fix issue with deleting a list
Browse files Browse the repository at this point in the history
  • Loading branch information
matsbov committed Jun 28, 2024
1 parent 224387e commit 83a5819
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ 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])
SpeciesListItem.executeUpdate("delete from SpeciesListItem where dataResourceUid = :dataResourceUid", ["dataResourceUid": sl.dataResourceUid])
MatchedSpecies.executeUpdate("delete from MatchedSpecies where id in (:msIds)", ["msIds": msIds])
SpeciesListKVP.executeUpdate("delete from SpeciesListKVP where dataResourceUid = :dataResourceUid", ["dataResourceUid": sl.dataResourceUid])
SpeciesList.executeUpdate("delete from SpeciesList where dataResourceUid = :dataResourceUid", ["dataResourceUid": sl.dataResourceUid])
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,8 @@ class HelperService {
totalRows = SpeciesListItem.count();
//Total rematch - Clean matchedSpecies table
MatchedSpecies.withTransaction {
MatchedSpecies.executeUpdate("delete from MatchedSpecies")
SpeciesListItem.executeUpdate("update SpeciesListItem set matched_species_id = null")
MatchedSpecies.executeUpdate("delete from MatchedSpecies")
}
}
}
Expand Down

0 comments on commit 83a5819

Please sign in to comment.