species with null taxonomic_status are now changed to use empty string instead, also change emptySpecies taxonomic_status from null to empty string

This commit is contained in:
juhanikat
2025-09-08 10:57:46 +03:00
parent 289c8f2d34
commit d3880d7019
3 changed files with 3 additions and 2 deletions
@@ -128,7 +128,7 @@ export const emptySpecies = {
genus_name: '',
species_name: '',
unique_identifier: '-',
taxonomic_status: null,
taxonomic_status: '',
common_name: '',
sp_author: '',
strain: null,
@@ -41,7 +41,7 @@ export const SpeciesDetails = () => {
}, [deleteSuccess, deleteError, notify, navigate])
useEffect(() => {
// changes subclass, suborder, and subfamily from null to empty string to make validators work
// changes subclass, suborder, subfamily and taxonomic_status from null to empty string to make validators work
// this should be removed if validators are improved in the future
if (data) {
const fixedSpeciesData = fixNullValuesInTaxonomyFields(data)
+1
View File
@@ -346,6 +346,7 @@ export const fixNullValuesInTaxonomyFields = (species: Species | SpeciesDetailsT
subclass_or_superorder_name: species.subclass_or_superorder_name ?? '',
suborder_or_superfamily_name: species.suborder_or_superfamily_name ?? '',
subfamily_name: species.subfamily_name ?? '',
taxonomic_status: species.taxonomic_status ?? '',
}
}