From fb09a37b3b40109eb78751595d15b874bdd577aa Mon Sep 17 00:00:00 2001 From: GiovannaNaves <110492330+GiovannaNaves@users.noreply.github.com> Date: Mon, 1 Jul 2024 20:39:08 -0300 Subject: [PATCH] Ajustes de endpoints --- docs/pages/app_createtopic.html | 2 +- docs/pages/app_edittopic.html | 36 +++++++++++++++---------------- docs/pages/app_sendmessage.html | 2 +- docs/pages/conteudo_staff.html | 2 +- docs/pages/script.js | 4 ++-- docs/pages/sendmessage_staff.html | 2 +- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/docs/pages/app_createtopic.html b/docs/pages/app_createtopic.html index 69489da..c3d0c9a 100644 --- a/docs/pages/app_createtopic.html +++ b/docs/pages/app_createtopic.html @@ -247,7 +247,7 @@

Criar Tópico

const formObject = Object.fromEntries(formData.entries()); formObject.categorias = categorias; - fetch('http://localhost:3000/topicos', { + fetch('http://localhost:3001/topicos', { method: 'POST', headers: { 'Content-Type': 'application/json', diff --git a/docs/pages/app_edittopic.html b/docs/pages/app_edittopic.html index c6313fe..e93d3d7 100644 --- a/docs/pages/app_edittopic.html +++ b/docs/pages/app_edittopic.html @@ -98,7 +98,7 @@ } form button { - background-color: blue; /* Mesma cor da navbar */ + background-color: blue; color: white; border: none; padding: 10px; @@ -106,14 +106,14 @@ } #backToForum { - background-color: blue; /* Mesma cor da navbar */ + background-color: blue; color: white; border: none; padding: 10px; cursor: pointer; - width: 100%; /* Largura total do formulário */ - margin-top: 20px; /* Espaço extra acima do botão */ - text-align: center; /* Centralizar texto */ + width: 100%; + margin-top: 20px; + text-align: center; } @@ -123,13 +123,13 @@ - +
@@ -160,17 +160,16 @@

Editar Tópico

diff --git a/docs/pages/script.js b/docs/pages/script.js index 666f7b1..69b2fb0 100644 --- a/docs/pages/script.js +++ b/docs/pages/script.js @@ -18,13 +18,13 @@ async function handleLogin(event) { var usuario = data.find(usuario => usuario.nome_usuario === nome_usuario && usuario.senha === senha); if (usuario) { - localStorage.setItem("UserId", usuario.UserId); // Armazenar o UserId no localStorage + localStorage.setItem("UserId", usuario.UserId); if (usuario.tipo_usuario == 'cliente') { localStorage.setItem("tipoUsuario", "cliente"); window.location.href = './conteudo.html'; } else if (usuario.tipo_usuario == 'admin') { localStorage.setItem("tipoUsuario", "admin"); - window.location.href = './conteudo.html'; + window.location.href = './conteudo_staff.html'; } else { alert('Tipo de usuário desconhecido'); } diff --git a/docs/pages/sendmessage_staff.html b/docs/pages/sendmessage_staff.html index f4633b9..baed7ce 100644 --- a/docs/pages/sendmessage_staff.html +++ b/docs/pages/sendmessage_staff.html @@ -146,7 +146,7 @@

Digite aqui sua dúvida

const messageObject = Object.fromEntries(formData.entries()); messageObject.autor = userName; - fetch('http://localhost:3000/mensagens', { + fetch('http://localhost:3001/mensagens', { method: 'POST', headers: { 'Content-Type': 'application/json',