Fluxos diversos

This commit is contained in:
Lucas Santana 2024-12-19 18:49:12 -03:00
parent 5192081bf0
commit 3efaf16c84
4 changed files with 18 additions and 17 deletions

View File

@ -1,7 +1,7 @@
import { StrictMode } from 'react'; import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client'; import { createRoot } from 'react-dom/client';
import { RouterProvider } from 'react-router-dom'; import { RouterProvider } from 'react-router-dom';
import { router } from '@/routes'; import { router } from './routes';
import './index.css'; import './index.css';
createRoot(document.getElementById('root')!).render( createRoot(document.getElementById('root')!).render(

View File

@ -67,11 +67,24 @@ export interface ClassWithStudents extends Class {
students: Student[]; students: Student[];
} }
export interface SchoolWithRelations extends School { // Interface base para School com relações
interface BaseSchoolWithRelations extends School {
teachers: Teacher[]; teachers: Teacher[];
}
// Interface específica para School com Classes e Students
export interface SchoolWithClasses extends BaseSchoolWithRelations {
classes: ClassWithStudents[]; classes: ClassWithStudents[];
} }
// Interface específica para School com Classes, Students e Stories
export interface SchoolWithClassesAndStories extends BaseSchoolWithRelations {
classes: ClassWithStudentsAndStories[];
}
// Removendo a interface duplicada e usando as novas interfaces específicas
export type SchoolWithRelations = SchoolWithClasses | SchoolWithClassesAndStories;
export interface StoryPage { export interface StoryPage {
text: string; text: string;
image?: string; image?: string;
@ -102,9 +115,3 @@ export interface StudentWithStories extends Student {
export interface ClassWithStudentsAndStories extends Class { export interface ClassWithStudentsAndStories extends Class {
students: StudentWithStories[]; students: StudentWithStories[];
} }
// Atualizando SchoolWithRelations
export interface SchoolWithRelations extends School {
teachers: Teacher[];
classes: ClassWithStudentsAndStories[];
}

View File

@ -13,11 +13,7 @@
"strict": true, "strict": true,
"noUnusedLocals": false, "noUnusedLocals": false,
"noUnusedParameters": false, "noUnusedParameters": false,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}
}, },
"include": ["src"] "include": ["src"]
} }

View File

@ -21,9 +21,7 @@ export default defineConfig({
}, },
resolve: { resolve: {
alias: { alias: {
'node-fetch': 'isomorphic-fetch', 'node-fetch': 'isomorphic-fetch'
'@': path.resolve(__dirname, './src') }
},
extensions: ['.js', '.jsx', '.ts', '.tsx']
} }
}); });