Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change payload from backend to frontend to be separated #41

Open
Christian-QA opened this issue Oct 3, 2021 · 0 comments
Open

Change payload from backend to frontend to be separated #41

Christian-QA opened this issue Oct 3, 2021 · 0 comments

Comments

@Christian-QA
Copy link
Owner

The former plan was to have the backend retrieve all data from a specific user and shove it all into one sorted case class, which is then deserialised again as it's requested by the frontend.

How it is now:
User(username, email, etc., MacroStats(stuff), Previous Weights(stuff))

This undermines the value of the backend while making the frontend unnecessarily more complex, as now the frontend has to go through the trouble of extracting individual element of the payload. The frontend also has to handle all user details for each request, rather than more specific details i.e. just Previous Weights.

A more ideal way would be to have the backend extract data into multiple case classes, each requested by the frontend separately.

For example:
User(username, email, etc.)
MacroStats(stuff)
PreviousWeights(stuff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant