(data: unknown)
| 21 | }); |
| 22 | |
| 23 | const resolver = async (data: unknown) => { |
| 24 | const { error, value: values } = validationSchema.validate(data, { |
| 25 | abortEarly: false, |
| 26 | }); |
| 27 | |
| 28 | return { |
| 29 | values: error ? {} : values, |
| 30 | errors: error |
| 31 | ? error.details.reduce((previous, { message, type, path }) => { |
| 32 | return { |
| 33 | ...previous, |
| 34 | [path[0]]: { |
| 35 | message, |
| 36 | type, |
| 37 | }, |
| 38 | }; |
| 39 | }, {}) |
| 40 | : {}, |
| 41 | }; |
| 42 | }; |
| 43 | |
| 44 | const BasicSchemaValidation: React.FC = () => { |
| 45 | const { mode } = useParams(); |
nothing calls this directly
no outgoing calls
no test coverage detected