Skip to content

Commit

Permalink
better types
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Nov 29, 2024
1 parent 6219c4f commit ea34817
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/List/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const List = styled("ul")(() => ({
* @returns string | React.JSX.Element - the `text` for the given value `val`, or the original value
*/
export function formatSchemaDisplayValue(
value: string | string[] | Record<string, string>,
value: string | string[],
field: Field,
) {
switch (field.type) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import {
AddressFields,
FormProps,
} from "@planx/components/AddressInput/Public";
import { AddressFields } from "@planx/components/AddressInput/Public";
import React from "react";
import InputLegend from "ui/editor/InputLegend";

Expand All @@ -27,7 +24,7 @@ export const AddressFieldInput: React.FC<Props<AddressField>> = (props) => {
)}
<AddressFields
id={id}
values={value as unknown as FormProps}
values={value}
errors={errorMessage}
handleChange={formik.handleChange}
/>
Expand Down
4 changes: 2 additions & 2 deletions editor.planx.uk/src/@planx/components/shared/Schema/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ export interface Schema {

export type SchemaUserResponse = Record<
Field["data"]["fn"],
string | string[] | Record<string, string> | any[]
>; // string | string[] | Record<string, string> | Feature[]
string | string[] | any
>; // string | string[] | Record<string, string> (address field) | Feature[] (map field)

/**
* Output data from a form using the useSchema hook
Expand Down

0 comments on commit ea34817

Please sign in to comment.