Skip to content

Commit

Permalink
[Unité] Amélioration de la recherche des unités (vue liste et fiche m…
Browse files Browse the repository at this point in the history
…ission) (#999)

- Resolve #372
  • Loading branch information
claire2212 authored Nov 20, 2023
2 parents d97d00c + 8f7ff1d commit f486724
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export function ControlUnitSelector({ controlUnitIndex, removeControlUnit }) {
const controlUnitCustomSearch = useMemo(
() =>
new CustomSearch(unitListAsOption || [], ['label'], {
isStrict: true,
threshold: 0.2
}),
[unitListAsOption]
Expand Down Expand Up @@ -133,9 +134,7 @@ export function ControlUnitSelector({ controlUnitIndex, removeControlUnit }) {

return
}
const resourceObjects = values
// ?.filter(value => typeof value === 'number')
.map(id => resourcesList.find(resource => resource.id === id))
const resourceObjects = values.map(id => resourcesList.find(resource => resource.id === id))
resourcesHelpers.setValue(resourceObjects)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function MissionsTableFilters() {
}, [legacyControlUnits, selectedAdministrationNames])

const controlUnitCustomSearch = useMemo(
() => new CustomSearch(controlUnitsAsOptions, ['label'], { threshold: 0.2 }),
() => new CustomSearch(controlUnitsAsOptions, ['label'], { isStrict: true, threshold: 0.2 }),
[controlUnitsAsOptions]
)

Expand Down

0 comments on commit f486724

Please sign in to comment.