Skip to content

Commit e35866f

Browse files
committed
chore: update dependencies; fix(admin, frontend): forms not updating values properly
1 parent 4e868ce commit e35866f

File tree

12 files changed

+1086
-879
lines changed

12 files changed

+1086
-879
lines changed

backend/package-lock.json

Lines changed: 250 additions & 200 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,46 +20,46 @@
2020
"dependencies": {
2121
"@emotion/react": "^11.14.0",
2222
"@emotion/styled": "^11.14.0",
23-
"@hookform/resolvers": "^5.0.1",
24-
"@mui/icons-material": "^7.1.0",
25-
"@mui/material": "^7.1.0",
26-
"@mui/x-data-grid": "^8.3.1",
27-
"@mui/x-date-pickers": "^8.3.1",
23+
"@hookform/resolvers": "^5.1.0",
24+
"@mui/icons-material": "^7.1.1",
25+
"@mui/material": "^7.1.1",
26+
"@mui/x-data-grid": "^8.5.1",
27+
"@mui/x-date-pickers": "^8.5.1",
2828
"axios": "^1.9.0",
2929
"date-fns": "^4.1.0",
3030
"history": "^5.3.0",
3131
"localized-strings": "^2.0.3",
3232
"nprogress": "^0.2.0",
3333
"react": "^19.1.0",
3434
"react-dom": "^19.1.0",
35-
"react-hook-form": "^7.56.4",
36-
"react-router-dom": "^7.6.0",
35+
"react-hook-form": "^7.57.0",
36+
"react-router-dom": "^7.6.2",
3737
"react-toastify": "^11.0.5",
3838
"rrule": "^2.8.1",
39-
"validator": "^13.15.0",
40-
"zod": "^3.25.17"
39+
"validator": "^13.15.15",
40+
"zod": "^3.25.56"
4141
},
4242
"devDependencies": {
43-
"@babel/plugin-transform-runtime": "^7.27.1",
43+
"@babel/plugin-transform-runtime": "^7.27.4",
4444
"@types/nprogress": "^0.2.3",
45-
"@types/react": "^19.1.5",
46-
"@types/react-dom": "^19.1.5",
45+
"@types/react": "^19.1.6",
46+
"@types/react-dom": "^19.1.6",
4747
"@types/validator": "^13.15.1",
48-
"@typescript-eslint/eslint-plugin": "^8.32.1",
49-
"@typescript-eslint/parser": "^8.32.1",
50-
"@vitejs/plugin-react": "^4.4.1",
48+
"@typescript-eslint/eslint-plugin": "^8.33.1",
49+
"@typescript-eslint/parser": "^8.33.1",
50+
"@vitejs/plugin-react": "^4.5.1",
5151
"babel-plugin-react-compiler": "^19.1.0-rc.2",
5252
"cross-env": "^7.0.3",
53-
"eslint": "^9.27.0",
53+
"eslint": "^9.28.0",
5454
"eslint-plugin-react": "^7.37.5",
5555
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
5656
"eslint-plugin-react-hooks": "^5.2.0",
5757
"eslint-plugin-react-refresh": "^0.4.20",
58-
"globals": "^16.1.0",
58+
"globals": "^16.2.0",
5959
"npm-check-updates": "^18.0.1",
60-
"stylelint": "^16.19.1",
60+
"stylelint": "^16.20.0",
6161
"stylelint-config-standard": "^38.0.0",
62-
"terser": "^5.39.2",
62+
"terser": "^5.41.0",
6363
"typescript": "^5.8.3",
6464
"vite": "^6.3.5",
6565
"vite-plugin-html": "^3.2.2"

backend/src/components/BookingFilter.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ const BookingFilter = ({
2828
onSubmit
2929
}: BookingFilterProps) => {
3030
const inputRef = useRef<HTMLInputElement>(null)
31-
const { control, getValues, register, handleSubmit, setValue, formState: { isSubmitting } } = useForm<FormFields>({
31+
const { control, register, handleSubmit, setValue, formState: { isSubmitting } } = useForm<FormFields>({
3232
resolver: zodResolver(schema),
3333
mode: 'onChange',
3434
})
3535

36+
const to = useWatch({ control, name: 'to' })
37+
const from = useWatch({ control, name: 'from' })
3638
const keyword = useWatch({ control, name: 'keyword' })
3739

3840
const [minDate, setMinDate] = useState<Date | undefined>(undefined)
@@ -73,10 +75,9 @@ const BookingFilter = ({
7375
<DatePicker
7476
{...register('from')}
7577
label={commonStrings.FROM}
76-
value={getValues('from')}
78+
value={from}
7779
onChange={(date) => {
7880
if (date) {
79-
const to = getValues('to')
8081
if (to && to.getTime() <= date.getTime()) {
8182
setValue('to', undefined)
8283
}
@@ -100,7 +101,7 @@ const BookingFilter = ({
100101
{...register('to')}
101102
label={commonStrings.TO}
102103
minDate={minDate}
103-
value={getValues('to')}
104+
value={to}
104105
onChange={(date) => setValue('to', date || undefined)}
105106
language={language}
106107
variant="standard"

backend/src/pages/UpdateBooking.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ const UpdateBooking = () => {
178178
setValue,
179179
formState: { errors, isSubmitting },
180180
clearErrors,
181-
getValues,
182181
trigger,
183182
} = useForm<FormFields>({
184183
resolver: zodResolver(schema),
@@ -208,6 +207,7 @@ const UpdateBooking = () => {
208207
const driver = useWatch({ control, name: 'driver' })
209208
const from = useWatch({ control, name: 'from' })
210209
const to = useWatch({ control, name: 'to' })
210+
const status = useWatch({ control, name: 'status' })
211211
const cancellation = useWatch({ control, name: 'cancellation' })
212212
const amendments = useWatch({ control, name: 'amendments' })
213213
const theftProtection = useWatch({ control, name: 'theftProtection' })
@@ -613,10 +613,9 @@ const UpdateBooking = () => {
613613
<FormControl fullWidth margin="dense">
614614
<StatusList
615615
label={blStrings.STATUS}
616-
value={getValues('status')}
616+
value={status}
617617
onChange={(value) => {
618-
const currentValue = getValues('status')
619-
if (currentValue !== value) {
618+
if (status !== value) {
620619
setValue('status', value)
621620
}
622621
}}
@@ -669,7 +668,7 @@ const UpdateBooking = () => {
669668
control={
670669
<Switch
671670
// {...register('amendments')}
672-
checked={getValues('amendments')}
671+
checked={amendments}
673672
color="primary"
674673
disabled={!carObj || !helper.carOptionAvailable(carObj, 'amendments')}
675674
onChange={async (e) => {
@@ -704,7 +703,7 @@ const UpdateBooking = () => {
704703
control={
705704
<Switch
706705
// {...register('theftProtection')}
707-
checked={getValues('theftProtection')}
706+
checked={theftProtection}
708707
color="primary"
709708
disabled={!carObj || !helper.carOptionAvailable(carObj, 'theftProtection')}
710709
onChange={async (e) => {
@@ -739,7 +738,7 @@ const UpdateBooking = () => {
739738
control={
740739
<Switch
741740
// {...register('collisionDamageWaiver')}
742-
checked={getValues('collisionDamageWaiver')}
741+
checked={collisionDamageWaiver}
743742
color="primary"
744743
disabled={!carObj || !helper.carOptionAvailable(carObj, 'collisionDamageWaiver')}
745744
onChange={async (e) => {
@@ -774,7 +773,7 @@ const UpdateBooking = () => {
774773
control={
775774
<Switch
776775
// {...register('fullInsurance')}
777-
checked={getValues('fullInsurance')}
776+
checked={fullInsurance}
778777
color="primary"
779778
disabled={!carObj || !helper.carOptionAvailable(carObj, 'fullInsurance')}
780779
onChange={async (e) => {
@@ -809,7 +808,7 @@ const UpdateBooking = () => {
809808
control={
810809
<Switch
811810
// {...register('additionalDriver')}
812-
checked={getValues('additionalDriver')}
811+
checked={additionalDriver}
813812
color="primary"
814813
disabled={!carObj || !helper.carOptionAvailable(carObj, 'additionalDriver')}
815814
onChange={async (e) => {

backend/src/pages/UpdateCar.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ const UpdateCar = () => {
6363
formState: { errors, isSubmitting },
6464
setValue,
6565
register,
66-
getValues,
6766
clearErrors,
6867
setFocus,
6968
} = useForm<FormFields>({
@@ -604,8 +603,7 @@ const UpdateCar = () => {
604603
label={strings.MULTIMEDIA}
605604
value={multimedia as bookcarsTypes.CarMultimedia[]}
606605
onChange={(value) => {
607-
const currentValue = getValues('multimedia')
608-
if (JSON.stringify(currentValue) !== JSON.stringify(value)) {
606+
if (JSON.stringify(multimedia) !== JSON.stringify(value)) {
609607
setValue('multimedia', value)
610608
}
611609
}}

0 commit comments

Comments
 (0)