diff --git a/src/components/ManyToOne.tsx b/src/components/ManyToOne.tsx index 669eeb6..35774df 100644 --- a/src/components/ManyToOne.tsx +++ b/src/components/ManyToOne.tsx @@ -21,14 +21,14 @@ interface Props { export const ManyToOne: FC = ({ entity, control,columname,columnvalue }) => { - const [values, setValues] = useState([{id:0, nombre: 'Seleccione'}]); + const [values, setValues] = useState([{id:0, columnvalue: 'Seleccione'}]); const [selectedIndex, setSelectedIndex] = React.useState(new IndexPath(0)); const displayValue = values[(selectedIndex as IndexPath).row]; useEffect(() => { async function fetchData() { try { const { data, error } = await useFetchWithAuth(entity.toLowerCase()); - const result = data as {id: number, nombre: string}[] + const result = data as {id: number, columnvalue: string}[] setValues (result); console.log(entity.toLowerCase()) } catch (error) { @@ -60,7 +60,7 @@ export const ManyToOne: FC = ({ entity, control,columname,columnvalue }) {values.map((item) => ( ))}