Pass token into Usage tracker
This commit is contained in:
parent
868aa018a4
commit
0911c9a7e5
|
@ -120,7 +120,7 @@ function App() {
|
|||
</Route>
|
||||
|
||||
<Route exact path='/usage/:name'>
|
||||
<Usage />
|
||||
<Usage token={token} />
|
||||
</Route>
|
||||
|
||||
<Route path='/'>
|
||||
|
|
|
@ -10,6 +10,7 @@ const deviceNames = {
|
|||
};
|
||||
|
||||
export function Usage(props) {
|
||||
const { token } = props;
|
||||
const { name } = useParams();
|
||||
const title = deviceNames[name].title;
|
||||
const device = deviceNames[name].device;
|
||||
|
@ -18,7 +19,7 @@ export function Usage(props) {
|
|||
const ref = useRef(null);
|
||||
|
||||
const getUsage = () => {
|
||||
requester('/stats/usage_data/?device='+device, 'GET', '')
|
||||
requester('/stats/usage_data/?device='+device, 'GET', token)
|
||||
.then(res => {
|
||||
setUsage(res);
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user