From 05cc3826e070f80f6547984993eb1aae2c0e1530 Mon Sep 17 00:00:00 2001 From: mheggelund Date: Wed, 31 Jan 2024 08:10:40 +0100 Subject: [PATCH] fix: replaced type any. --- src/components/AreaCoordinates/AreaCoordinates.tsx | 4 ++-- .../AreaCoordinates/CoordinateInput/CoordinateInput.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/AreaCoordinates/AreaCoordinates.tsx b/src/components/AreaCoordinates/AreaCoordinates.tsx index 7f60c204..e20df68c 100644 --- a/src/components/AreaCoordinates/AreaCoordinates.tsx +++ b/src/components/AreaCoordinates/AreaCoordinates.tsx @@ -319,12 +319,12 @@ export const AreaCoordinates = ({ modelId }: { modelId: string }) => { return 'success'; }; - const setCoordinates = (target: any, index: number, axis: string) => { + const setCoordinates = (valute: string, index: number, axis: string) => { if (!areaCoordinate) return; const uppdatedArea = { ...areaCoordinate?.coordinates[index], - [axis]: target.value, + [axis]: valute, }; const newCoordinates = { ...areaCoordinate }; newCoordinates.coordinates[index] = uppdatedArea; diff --git a/src/components/AreaCoordinates/CoordinateInput/CoordinateInput.tsx b/src/components/AreaCoordinates/CoordinateInput/CoordinateInput.tsx index 9445a375..86066277 100644 --- a/src/components/AreaCoordinates/CoordinateInput/CoordinateInput.tsx +++ b/src/components/AreaCoordinates/CoordinateInput/CoordinateInput.tsx @@ -15,7 +15,7 @@ export const CoordinateInput = ({ label: string; error: boolean; areaCoordinate: AreaCoordinateType | undefined; - setCoordinates: (target: any, index: number, axis: string) => void; + setCoordinates: (value: string, index: number, axis: string) => void; position: number; axis: string; activeArea: ModelAreaTypeDto; @@ -29,8 +29,8 @@ export const CoordinateInput = ({ ? areaCoordinate?.coordinates[position].x : areaCoordinate?.coordinates[position].y } - onChange={(input: { target: any }) => - setCoordinates(input.target, position, axis) + onChange={(e: React.FormEvent) => + setCoordinates(e.currentTarget.value, position, axis) } rightAdornments={ error ? (