Show list of verifications

This commit is contained in:
2020-12-30 19:24:37 -05:00
parent 0b5df2733d
commit a5354ddd6e
2 changed files with 74 additions and 9 deletions

View File

@ -1,4 +1,19 @@
function Card(data) {
return (
<div class="card">
<h4><b>{data.Username}</b></h4>
<div class="container">
<p>{data.Closed}</p>
<p>{data.UserID}</p>
</div>
</div>
)
}
class Verification extends React.Component {
state = {
verifications: []
}
constructor(props) {
super(props);
}
@ -6,11 +21,17 @@ class Verification extends React.Component {
const apiUrl = 'https://thanos.nightmare.haus/api/verifications';
fetch(apiUrl)
.then((response) => response.json())
.then((data) => console.log('The data from the call: ', data));
.then((data) => this.setState({verifications: data}));
}
render() {
return (
<div><h1>Verifications have loaded. See logs.</h1></div>
<div>
<ul>
{this.state.verifications.map((data) => (
<li key={data.UserID}> <Card {...data} /></li>
))}
</ul>
</div>
);
}
}