I am having trouble resolving this promise.
const getAge = (actorId) => {
return (
axios.get(`https://api.themoviedb.org/3/person/${actorId}?api_key=${process.env.REACT_APP_API_KEY}&language=en-US`)
.then(function (response) {
return moment().diff(response.data.birthday, 'years')
})
.catch(function (error) {
console.log(error);
})
)
}
console.log(getAge('5000'), 'FUNCTION')
It doesnt ever resolve the promise and returns pending
I have tried a number of different ideas and none seem to work. What Am I missing?
Thanks