pretty simple question for some of you out there but, basically I have this line of code
.then(response => response.json())
.then(data => {
this.setState(Object.assign(this.state.user, { entries: data.count}))
})
And I have no idea why I have to do data.count to get the number of entries?
None of the variables in the object returned are called count. So is it a json thing?
Heres what it returned when I console.log data
{id: "123", name: "john", email: "j@gmail.com", password: "cookies", entries: 14, …}
id: "123"
name: "john"
email: "j@gmail.com"
password: "cookies"
entries: 14
joined: "2020-06-10T21:36:42.041Z"
__proto__: Object
Everything besides proto I have predefined in an object called user.