OpenClassrooms-Student-Center / OpenClassrooms-Student-Center/P6JS

Inconsistent goal / weeklyGoal field structure across users in data.json

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

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

https://github.com/OpenClassrooms-Student-Center/P6JS/blob/a2eb23cb0a6c99a257f77203cd2b030021ca03d7/app/data.json#L4

User 2 uses goal at root level

https://github.com/OpenClassrooms-Student-Center/P6JS/blob/a2eb23cb0a6c99a257f77203cd2b030021ca03d7/app/data.json#L370

User 3 uses goal inside userInfos

https://github.com/OpenClassrooms-Student-Center/P6JS/blob/a2eb23cb0a6c99a257f77203cd2b030021ca03d7/app/data.json#L998

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.