Create a view model for the day details #161

Merged
savanni merged 3 commits from fitnesstrax/detail-view-model into main 2024-01-20 20:17:27 +00:00
Owner

I was having a lot of excess code dealing with handling data embedded into the middle of the view components. This got very complicated.

The view model holds all of the detail needed for DaySummary, DayDetail, and DayEdit, and manages the state of the data within the model. Then, when it's time to save data, it handles all of the details of committing the updated records to the database.

This PR also gets made much larger with a lot of linting fixes.

I was having a lot of excess code dealing with handling data embedded into the middle of the view components. This got very complicated. The view model holds all of the detail needed for DaySummary, DayDetail, and DayEdit, and manages the state of the data within the model. Then, when it's time to save data, it handles all of the details of committing the updated records to the database. This PR also gets made much larger with a lot of linting fixes.
savanni added 3 commits 2024-01-20 20:16:08 +00:00
18e7e4fe2f Start setting up the day detail view model
I've created the view model and added a getter function for the weight.
I'm passing the view model now to the DayDetailView, DayDetail, and
DayEdit.

I'm starting to set up the Save function for the view model, draining
all of the updated records and saving them.

None of the components yet save any updates to the view model, so
updated_records is always going to be empty until I figure that out.
savanni merged commit 9bedb7a76c into main 2024-01-20 20:17:27 +00:00
savanni deleted branch fitnesstrax/detail-view-model 2024-01-20 20:17:27 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: savanni/monorepo#161
No description provided.