Browse Source

add props

pull/1/head
wahyuun 1 year ago
parent
commit
9f46a76585
  1. 17
      src/views/Dashboard/DashboardBOD.js

17
src/views/Dashboard/DashboardBOD.js

@ -13,8 +13,21 @@ import toRupiah from '@develoka/angka-rupiah-js';
import Icon from '@iconify/react';
import { HealthByBudget, HealthBySchedule } from './Components';
const DashboardBOD = () => {
const token = localStorage.getItem("token")
const DashboardBOD = (props) => {
let role_id = '', user_id='',isLogin='',token='';
if (props.location.state && props.location.state.role_id && props.location.state.user_id) {
role_id = props.location.state.role_id;
user_id = props.location.state.user_id;
token = props.location.state.token;
isLogin = props.location.state.isLogin;
console.log('props.location.state success');
} else {
role_id = localStorage.getItem("role_id");
user_id = localStorage.getItem("user_id");
token = localStorage.getItem("token");
isLogin = localStorage.getItem("isLogin");
console.error('undefined in props.location.state');
}
const HEADER = {
headers: {
"Content-Type": "application/json",

Loading…
Cancel
Save