Skip to content

Commit

Permalink
bug/CE-487 - fixes problem with default values (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
marqueone-ps authored Feb 14, 2024
1 parent 378c976 commit 35c547c
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const AddAnimalOutcome: FC<props> = ({ animalCount, agency, species, assi

const [data, applyData] = useState<AnimalOutcome>({
id: animalCount,
species: "",
species: species,
sex: "",
age: "",
threatLevel: "",
Expand All @@ -57,15 +57,7 @@ export const AddAnimalOutcome: FC<props> = ({ animalCount, agency, species, assi
});

useEffect(() => {
if (species) {
updateModel("species", species);
}
}, [species]);

useEffect(() => {
if (assigned) {
updateModel("officer", assigned);
}
updateModel("officer", assigned);
}, [assigned]);

const getValue = (property: string): Option | undefined => {
Expand Down Expand Up @@ -226,7 +218,7 @@ export const AddAnimalOutcome: FC<props> = ({ animalCount, agency, species, assi

return (
<>
<div className="comp-outcome-report-container">Drug{drugs.length >1 && "s"}</div>
<div className="comp-outcome-report-container">Drug{drugs.length > 1 && "s"}</div>

{from(drugs)
.orderBy((item) => item.id)
Expand Down

0 comments on commit 35c547c

Please sign in to comment.