diff --git a/editor.planx.uk/src/@planx/components/Checklist/Editor.tsx b/editor.planx.uk/src/@planx/components/Checklist/Editor.tsx index 166d0fd765..8c52fd02fd 100644 --- a/editor.planx.uk/src/@planx/components/Checklist/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/Checklist/Editor.tsx @@ -5,7 +5,7 @@ import FormControlLabel from "@mui/material/FormControlLabel"; import IconButton from "@mui/material/IconButton"; import Switch from "@mui/material/Switch"; import { ComponentType as TYPES } from "@opensystemslab/planx-core/types"; -import { useFormik } from "formik"; +import { FormikErrors, FormikValues, useFormik } from "formik"; import adjust from "ramda/src/adjust"; import compose from "ramda/src/compose"; import remove from "ramda/src/remove"; @@ -313,7 +313,7 @@ export const ChecklistComponent: React.FC = (props) => { } }, validate: ({ options, ...values }) => { - const errors: Record = {}; + const errors: FormikErrors = {}; if (values.fn && !options?.some((option) => option.data.val)) { errors.fn = "At least one option must set a data value when the checklist has a data field"; diff --git a/editor.planx.uk/src/@planx/components/Question/Editor.tsx b/editor.planx.uk/src/@planx/components/Question/Editor.tsx index 9c027936df..c3160c7238 100644 --- a/editor.planx.uk/src/@planx/components/Question/Editor.tsx +++ b/editor.planx.uk/src/@planx/components/Question/Editor.tsx @@ -1,8 +1,7 @@ -import { errors } from "@airbrake/browser/dist/http_req/api"; import FormControlLabel from "@mui/material/FormControlLabel"; import Switch from "@mui/material/Switch"; import { ComponentType as TYPES } from "@opensystemslab/planx-core/types"; -import { useFormik } from "formik"; +import { FormikErrors, FormikValues, useFormik } from "formik"; import React, { useEffect, useRef } from "react"; import { ComponentTagSelect } from "ui/editor/ComponentTagSelect"; import ImgInput from "ui/editor/ImgInput/ImgInput"; @@ -157,12 +156,11 @@ export const Question: React.FC = (props) => { } }, validate: ({ options, ...values }) => { - const errors: Record = {}; + const errors: FormikErrors = {}; if (values.fn && !options.some((option) => option.data.val)) { errors.fn = "At least one option must set a data value when the question has a data field"; } - return errors; }, });