Skip to content

Commit

Permalink
React d ts, type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vvaldesc committed Jun 16, 2024
1 parent 0dd0197 commit 8f148a2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
5 changes: 5 additions & 0 deletions react.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// react.d.ts
declare module '*.jsx' {
const content: React.FC | React.ComponentClass;
export default content;
}
5 changes: 4 additions & 1 deletion src/components/AntDesign/modals/Docent_post_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ const Docent_post_modal: React.FC = () => {
setIsModalOpen(false);
};


async function createProfile(
values: (Student & Employee) | (Teacher & Employee),
setError: React.Dispatch<React.SetStateAction<boolean>>,
setMessage: React.Dispatch<React.SetStateAction<string>>,
setLoadingUpload: React.Dispatch<React.SetStateAction<boolean>>
) {
//@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");
Expand Down Expand Up @@ -144,7 +147,7 @@ const Docent_post_modal: React.FC = () => {
<Button type="primary" onClick={showModal}>
Crear un profesor o estudiante
</Button>
<Modal title="Docencia y estudiantes" footer={null} title="Basic Modal" visible={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
<Modal title="Docencia y estudiantes" footer={null} visible={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
<Form form={form} onFinish={onFinish}>
<Form.Item name="image">
<input
Expand Down
9 changes: 0 additions & 9 deletions src/components/AntDesign/tables/Students_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,6 @@ const App: React.FC<{ studentsResult: any; loadingStudents: boolean }> = ({
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",
Expand Down
2 changes: 1 addition & 1 deletion src/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8f148a2

Please sign in to comment.