Merge branch '40-re-fix-navbar-and-devicepanel' into 'dev'

re-fix navbar and device panel

Closes #40

See merge request sa4-2020/the-sanmarinoes/frontend!37
This commit is contained in:
Claudio Maggioni 2020-03-18 13:35:05 +01:00
commit 7faa63e484
2 changed files with 4 additions and 10 deletions

View file

@ -31,20 +31,16 @@ export default class Dashboard extends Component{
componentDidMount() { componentDidMount() {
call.getAllRooms(this.props.tkn) call.getAllRooms(this.props.tkn)
.then(res => { .then(res => {
console.log(res.data.length);
res.data.forEach((e) => {
this.setState({ this.setState({
rooms: res.data rooms: res.data
}); });
});
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });
call.getAllDevices(this.props.tkn) call.getAllDevices(this.props.tkn)
.then(res => { .then(res => {
console.log(res);
this.setState({ this.setState({
devices : res.data devices: res.data
}); });
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
@ -79,11 +75,9 @@ export default class Dashboard extends Component{
//da fare richiesta get della room e settare activeItem //da fare richiesta get della room e settare activeItem
call.getAllDevicesByRoom(id, this.props.tkn) call.getAllDevicesByRoom(id, this.props.tkn)
.then(res => { .then(res => {
res.data.forEach((e) => {
this.setState({ this.setState({
devices: res.data devices: res.data
}); });
});
}).catch(err => { }).catch(err => {
console.log(err); console.log(err);
}); });