Skip to content

Commit

Permalink
Create matricula pelo sistema
Browse files Browse the repository at this point in the history
  • Loading branch information
TI JONNY committed Apr 26, 2024
1 parent 652a55d commit 8e24de2
Show file tree
Hide file tree
Showing 5 changed files with 553 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/context/Registration/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const RegistrationState = () => {
cpf: dataValues.cpf ? dataValues.cpf.replace(/\D/g, '') : null,
horasUsoAparelhosEletronicos: parseInt(dataValues.horasUsoAparelhosEletronicos),
horasAtividadesAoArLivre: parseInt(dataValues.horasAtividadesAoArLivre)
}, history)
}, history, "/")

};

Expand Down
4 changes: 2 additions & 2 deletions src/controller/registration/createRegistration.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { collection } from "@firebase/firestore"
import { addDoc } from "@firebase/firestore"


const handleSubmitStudent = (body, history) => {
const handleSubmitStudent = (body, history, path) => {
const ref = collection(firestore, "student");

let data = body

try {
addDoc(ref, data)
history.push("/")
history.push(path)
} catch (err) {
console.log(err)
}
Expand Down
5 changes: 3 additions & 2 deletions src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { isAuthenticated } from "./services/auth";
import PdfTodasReceita from "./Pdf/PdfTodasReceitas";
import CreateUserScreen from "./screens/Users/CreateUser";
import PrivateRouterProvider from "./context/PrivateRouter/context";
import CreateRegistration from "./screens/Classroom/CreateRegistration";

//const Home = lazy(() => import("./containers/Home"));

Expand Down Expand Up @@ -61,19 +62,19 @@ const Routes = () => (
<PrivateRoute exact path="/escolas/:id" component={SchoolClassrooms} />
<PrivateRoute exact path="/criar/escolas" component={SchoolCreate} />
<PrivateRoute exact path="/turmas" component={Classroom} />

<PrivateRoute
exact
path="/turmas/:id/matricula/:idRegistration"
component={RegistrationClassroom}
/>

<Route
exact
path="/turmas/:id/matricula/:idRegistration/receita"
component={PdfReceita}
/>
<PrivateRoute exact path="/turmas/:id" component={ClassroomForm} />
<PrivateRoute exact path="/turmas/:id/criar-aluno" component={CreateRegistration} />

<PrivateRoute
exact
path="/turmas/:id/matricula/:idRegistration"
Expand Down
Loading

0 comments on commit 8e24de2

Please sign in to comment.