Skip to content

Commit

Permalink
Inicio da integração da tela reuniao
Browse files Browse the repository at this point in the history
  • Loading branch information
julia-fortunato committed Jun 13, 2024
1 parent fbdce10 commit cef08e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion view/src/pages/Documents/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function deletarDoc(id) {

function criarDocumento(descricao, link) {
// Variável para armazenar o ID do usuário
const userId = 12; // Altere conforme necessário
const userId = 1; // Altere conforme necessário

// Dados a serem enviados no corpo da solicitação POST
const data = {
Expand Down
19 changes: 17 additions & 2 deletions view/src/pages/Meeting/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import React, { useState } from "react";
import React, { useState,useEffect } from "react";
import './Meeting.css';
import SideBar from "../../components/SideBar";
import axios from "axios";

function criarReuniao(titulo){
axios.post("http://localhost:3000/reuniaos",{
nome: titulo
});
}

function Meeting() {
const [meetings, setMeetings] = useState([]);
Expand All @@ -12,7 +19,15 @@ function Meeting() {
const [links, setLinks] = useState([]);
const [titulo, setTitulo] = useState('');
const [editTitleIndex, setEditTitleIndex] = useState(-1);
const [reunioes, setMeet] = useState([]);


useEffect(()=>{
axios.get("http://localhost:3000/reuniaos").then(function (response){
setMeet(response.data);
});
},[]);

const handleAddMeetingClick = () => {
setShowPopup2(true);
};
Expand Down Expand Up @@ -127,7 +142,7 @@ function Meeting() {
required
/>
</label>
<button type="submit" className='botao'>{editTitleIndex > -1 ? 'Salvar' : 'Adicionar'}</button>
<button type="submit" onClick={()=>criarReuniao(titulo)} className='botao'>{editTitleIndex > -1 ? 'Salvar' : 'Adicionar'}</button>
</form>
</div>
</div>
Expand Down

0 comments on commit cef08e0

Please sign in to comment.