From 8f148a21a497d618601c79cf585612dc3671e14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor?= Date: Sun, 16 Jun 2024 15:36:47 +0200 Subject: [PATCH] React d ts, type fixes --- react.d.ts | 5 +++++ src/components/AntDesign/modals/Docent_post_modal.tsx | 5 ++++- src/components/AntDesign/tables/Students_table.tsx | 9 --------- src/models/types.ts | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) create mode 100644 react.d.ts diff --git a/react.d.ts b/react.d.ts new file mode 100644 index 0000000..86bdc7d --- /dev/null +++ b/react.d.ts @@ -0,0 +1,5 @@ +// react.d.ts +declare module '*.jsx' { + const content: React.FC | React.ComponentClass; + export default content; +} \ No newline at end of file diff --git a/src/components/AntDesign/modals/Docent_post_modal.tsx b/src/components/AntDesign/modals/Docent_post_modal.tsx index dca9bea..b52fe94 100644 --- a/src/components/AntDesign/modals/Docent_post_modal.tsx +++ b/src/components/AntDesign/modals/Docent_post_modal.tsx @@ -34,15 +34,18 @@ const Docent_post_modal: React.FC = () => { setIsModalOpen(false); }; + async function createProfile( values: (Student & Employee) | (Teacher & Employee), setError: React.Dispatch>, setMessage: React.Dispatch>, setLoadingUpload: React.Dispatch> ) { + //@ts-ignore if (values.matriculation_number) { let response; try { + // @ts-ignore response = await postStudent(values as Teacher); if (response.status !== 201) throw new Error("Error creando registro estudiante"); @@ -144,7 +147,7 @@ const Docent_post_modal: React.FC = () => { - +
= ({ width: "5%", render: (_: any, record: Item) => record.username, }, - { - title: "Confirmado", - dataIndex: "confirmed", - key: "confirmed", - // @ts-ignore - editable: true, - width: "5%", - render: (_: any, record: Item) => record.confirmed ? "Sí" : "No", - }, { title: "Imagen", dataIndex: "image", diff --git a/src/models/types.ts b/src/models/types.ts index 940afd7..eacf633 100644 --- a/src/models/types.ts +++ b/src/models/types.ts @@ -71,7 +71,7 @@ export enum Role { export interface Student { id?: number; - matriculation_number?: string; + matriculation_number: string; DNI?: string; employed?: boolean; educational_level?: string;