As a user, when I click on an event's financial reporting page, I should be able to see the total costs of a specific component.
AC
When a user is authenticated
And on an events page's financial reporting page
Then they should be able to see a breakdown of total costs by a specific component (such as food)
Dev Notes
create a smash function in a smash.js file that grabs food by event-src/javascripts/helpers/data/smash.js
User
As a user, when I click on an event's financial reporting page, I should be able to see the total costs of a specific component.
AC
When a user is authenticated And on an events page's financial reporting page Then they should be able to see a breakdown of total costs by a specific component (such as food)
Dev Notes
src/javascripts/helpers/data/smash.js
getAllFoodByEventId(eventId) .then((eventWithFoods) => { const foodCost = eventWithFoods.reduce((accumulator, food) => { return accumulator + food.price }, 0); }) .catch((err) => console.error('error in getAllFoodByEventId', err))```