Grab user data from web server
This commit is contained in:
@@ -5,15 +5,15 @@ import { Link } from 'react-router-dom';
|
||||
class Tool extends Component {
|
||||
render() {
|
||||
const data = this.props.data;
|
||||
const user = data.user;
|
||||
const user = this.props.user;
|
||||
const match = this.props.match;
|
||||
|
||||
const category = data.categories.find((x) =>
|
||||
x.slug == match.params.category
|
||||
x.slug === match.params.category
|
||||
);
|
||||
|
||||
const tool = category.tools.find((x) =>
|
||||
x.id == match.params.id
|
||||
x.id.toString() === match.params.id
|
||||
);
|
||||
|
||||
const approved = user.authorizedTools.includes(tool.id);
|
||||
|
||||
Reference in New Issue
Block a user