I want to update a field when a user clicks the specific image. I added an onClick method to the image, and the function is below.
I got a space.getEntry not a function error at the end.
client.getSpace(‘x18qe0iaxip2’).then((space) => space.getEntry(‘favorited’))
.then((entry) => {
entry.fields.favorited = true
return entry.update()
})
.then(entry => console.log(entry.fields.favorited))