From 2da9f7904d74bd16475d01f5f02f64eb6ce344c9 Mon Sep 17 00:00:00 2001 From: freddyheredia4 Date: Sun, 30 Jul 2023 07:23:40 -0500 Subject: [PATCH] agrega columna dinamica --- src/components/ManyToOne.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) => ( ))}