Getting dashboard data

This commit is contained in:
Tomasz 2021-02-07 21:03:14 +01:00
parent 82e98b1bc6
commit 74126abd33

View file

@ -1,6 +1,23 @@
import React, { Component } from 'react';
class DashboardCom extends Component {
constructor(props) {
super(props)
var cookies_data = sessionStorage.getItem('cookies_data');
var csrfcookie_ = sessionStorage.getItem('csrfcookie');
fetch('../api/dashboard', {
method: 'POST',
mode: 'cors',
headers: {
'Content-Type': 'application/json',
'X-CSRFToken': csrfcookie_
},
body: cookies_data
}).then(response => response.json()).then(data => {
console.log(data)
})
}
render() {
return (
<p>Dashboard</p>