when I go back in previous route I get an error in this line
meals = data.meals.map(meal => meal);
:
Type Error, Cannot read property 'map' of null
request(options, (error, response, body) => {
const data = JSON.parse(response.body);
if (error) {
console.log(error);
} else {
const meals = data.meals.map(meal => meal);
console.log(response.statusCode);
res.render("result", { categories: meals, title: category });
}
});