mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
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:
@@ -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)
|
||||
|
||||
@@ -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 ?? '',
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user