mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
fix lint issues and slight changes in OccurrenceDetails
This commit is contained in:
@@ -109,9 +109,7 @@ export const OccurrenceDetails = () => {
|
||||
const { id, lid, speciesId } = useParams()
|
||||
const [searchParams] = useSearchParams()
|
||||
const isNew = id === 'new'
|
||||
if (isNew) {
|
||||
document.title = 'New locality'
|
||||
}
|
||||
|
||||
const parsedLid = lid ? parseInt(lid, 10) : -1
|
||||
const parsedSpeciesId = speciesId ? parseInt(speciesId, 10) : -1
|
||||
const {
|
||||
@@ -129,8 +127,10 @@ export const OccurrenceDetails = () => {
|
||||
const navigate = useNavigate()
|
||||
const [editLocalityRequest, { isLoading: mutationLoading }] = useEditLocalityMutation()
|
||||
|
||||
// these two should exist if the occurrence is created through a locality's Occurrences tab
|
||||
const lidFromSearchParams = searchParams.get('lid')
|
||||
const locNameFromSearchParams = searchParams.get('loc_name')
|
||||
|
||||
const localityId = lidFromSearchParams ?? lid ?? ''
|
||||
const { data: localityData } = useGetLocalityDetailsQuery(localityId)
|
||||
|
||||
@@ -142,6 +142,7 @@ export const OccurrenceDetails = () => {
|
||||
if (isNew) {
|
||||
initialOccurrence.lid = parseInt(localityId, 10)
|
||||
initialOccurrence.loc_name = locNameFromSearchParams ?? ''
|
||||
document.title = `New Occurrence`
|
||||
}
|
||||
|
||||
if (occurrenceData) {
|
||||
|
||||
@@ -13,8 +13,6 @@ export const OccurrenceWearTab = () => {
|
||||
)
|
||||
const normalizedScoreText = normalizedScore === null ? '-' : normalizedScore.toFixed(2)
|
||||
|
||||
console.log(editData)
|
||||
|
||||
return (
|
||||
<HalfFrames>
|
||||
{[
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useDetailContext } from '@/components/DetailView/Context/DetailContext'
|
||||
import { checkFieldErrors } from '@/components/DetailView/common/checkFieldErrors'
|
||||
import { DataValue } from '@/components/DetailView/common/tabLayoutHelpers'
|
||||
import type { EditDataType, SpeciesDetailsType } from '@/shared/types'
|
||||
import type { TaxonomySuggestionField as TaxonomySuggestionFieldName } from './taxonomySuggestions'
|
||||
import type { TaxonomySuggestionFieldName } from './taxonomySuggestions'
|
||||
|
||||
const FIELD_WIDTH = '14em'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user