feat: SW-276 Optimized code
This commit is contained in:
@@ -21,7 +21,7 @@ import {
|
||||
export default function AdultSelector({ roomIndex = 0 }: AdultSelectorProps) {
|
||||
const intl = useIntl()
|
||||
const adultsLabel = intl.formatMessage({ id: "Adults" })
|
||||
const { register, setValue } = useFormContext()
|
||||
const { trigger, setValue } = useFormContext()
|
||||
const { adults, children, childrenInAdultsBed } = useGuestsRoomsStore(
|
||||
(state) => state.rooms[roomIndex]
|
||||
)
|
||||
@@ -47,6 +47,7 @@ export default function AdultSelector({ roomIndex = 0 }: AdultSelectorProps) {
|
||||
`rooms.${roomIndex}.children.${toUpdateIndex}.bed`,
|
||||
children[toUpdateIndex].age < 3 ? 1 : 2
|
||||
)
|
||||
trigger()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user