I got data back from a fetch request and it is a object
const SendLogin = async () =>{
const res = await fetch('https://localhost:44332/api/AdminAuth/AdminLogin',{
method: 'POST',
headers:{'Content-Type': 'application/json'},
body: JSON.stringify({
email,
password
})
});
if(res.status === 200){
console.log("Succesful login")
await res.text().then(function(text){console.log(text)});
the console loge gives:
{"id":26,"accestoken":"3ed3247b-1fc1-462c-9c6b-73f1172876eb","email":"admin@hotmail.com","role":"Admin","name":"Administrator"}
How do i Destructure this object so i can use the information in it?