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
Also deletes goals, and returns updated list of goals in order to update journal 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. Might also be useful to move all of the functions that affect goals into the context to be more accessible.
goals currently display with the oldest first, but it would be nice to do the opposite. #119
I've just been building on the previous PRs that I've been making, so this is getting kind of big! Feel free to ask any questions that you might have!!
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
Also deletes goals, and returns updated list of goals in order to update journal page.
Bugs/todo later:
I've just been building on the previous PRs that I've been making, so this is getting kind of big! Feel free to ask any questions that you might have!!