forked from RiseUP/riseup-squad21
pequenos ajustes
This commit is contained in:
parent
8130ce47ec
commit
7455a57891
@ -30,7 +30,6 @@ export default function PacientesPage() {
|
|||||||
setPatientDetails(null);
|
setPatientDetails(null);
|
||||||
try {
|
try {
|
||||||
const res = await patientsService.getById(patientId);
|
const res = await patientsService.getById(patientId);
|
||||||
console.log(res)
|
|
||||||
setPatientDetails(res[0]);
|
setPatientDetails(res[0]);
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
setPatientDetails({ error: e?.message || "Erro ao buscar detalhes" });
|
setPatientDetails({ error: e?.message || "Erro ao buscar detalhes" });
|
||||||
|
|||||||
@ -17,18 +17,16 @@ async function login() {
|
|||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
console.log(data.access_token)
|
console.log(data.access_token)
|
||||||
// salvar o token do usuário
|
// salvar o token do usuário
|
||||||
//localStorage.setItem("token", data.access_token);
|
localStorage.setItem("token", data.access_token);
|
||||||
tempToken = data.access_token
|
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
await login()
|
await login()
|
||||||
|
|
||||||
async function request(endpoint, options = {}) {
|
async function request(endpoint, options = {}) {
|
||||||
//const token = localStorage.getItem("token"); // token do usuário, salvo no login
|
const token = localStorage.getItem("token"); // token do usuário, salvo no login
|
||||||
const token = tempToken;
|
|
||||||
|
|
||||||
console.log(`endpoint: ${endpoint}`)
|
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user