OpenClassrooms-Student-Center / OpenClassrooms-Student-Center/P6JS
Inconsistent goal / weeklyGoal field structure across users in data.json
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I noticed an inconsistency in the backend mock data structure for user goals, which can cause issues when consuming the API from the frontend.
Currently, the 3 sample users store the goal value in 3 different ways:
User 1 uses weeklyGoal at root level
User 2 uses goal at root level
User 3 uses goal inside userInfos
The same data is stored:
-
with different property names (goal vs weeklyGoal)
-
at different nesting levels (root level vs inside userInfos)
This makes frontend integration harder because extra conditional logic is required depending on the user.
Suggested Fix:
Normalize all users in data.json to use the same field name and same location.
Thank you!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the three user records in app/data.json at the linked locations and compare the goal fields and nesting. Confirm the canonical field name and location with maintainers, then normalize all users consistently and verify that the mock API data remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100