Backend route and database query for all goals from the logged in user. Saves in context and populates the journal page with the returned goals. This means that @SalwaMugh, you should be able to populate the dashboard goals with items from context.state.goalData 🙂
Also uses the same route inside the function to add goals, so that whenever we add a new one, an updated list of goals is returned and rendered on the page
Bugs/todo later:
still currently depends on a hard coded user id, stored in the context
eventually we can also separate the api call into a separate file that can be called on both the journal page and the dashboard page
goals currently display with the oldest first, but it would be nice to do the opposite. #119
Backend route and database query for all goals from the logged in user. Saves in context and populates the journal page with the returned goals. This means that @SalwaMugh, you should be able to populate the dashboard goals with items from context.state.goalData 🙂
Also uses the same route inside the function to add goals, so that whenever we add a new one, an updated list of goals is returned and rendered on the page
Bugs/todo later: