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

[LaE] control levels/lessons #562

Closed
vibern0 opened this issue Apr 11, 2023 · 1 comment · Fixed by #576
Closed

[LaE] control levels/lessons #562

vibern0 opened this issue Apr 11, 2023 · 1 comment · Fixed by #576

Comments

@vibern0
Copy link
Contributor

vibern0 commented Apr 11, 2023

Right now, frontend filters the levels and maps languages. This should not happen.
Lets get all content to backend and return only the necessary data for the frontend to render the right content to the user.

@vibern0
Copy link
Contributor Author

vibern0 commented Apr 12, 2023

Existing logic as resource

https://github.com/impactMarket/app/tree/main/src/hooks/learn-and-earn

https://github.com/impactMarket/app/blob/main/src/pages/learn-and-earn/index.tsx

Needed changes:

/v2/learn-and-earn/levels

Needs to be able to be called by non-logged users
Add support to languages to users non-connected, with a parameter

Changes on response

{
  "success": true,
  "data": {
    "count": 6,
    "rows": [
      {
        "id": 52,
        "prismicId": "Y7azCBIAAC0AsPuR", // this needs to be by language
        "totalReward": 700,
        "totalLessons": 7,
        "status": "available"
        "status": "PACT" // include token as well
      },
      ......
    ]
  }
}

/v2/learn-and-earn/levels/{id}

If possible, accept primiscId as parameter.
Needs to be able to be called by non-logged users
Add support to languages to users non-connected, with a parameter

Changes on response

{
  "success": true,
  "data": {
    "totalPoints": 0,
    "rewardAvailable": true,
    "completedToday": false,
    "lessons": [
      {
        "id": 80,
        "prismicId": "Y7avxBIAACoAsPac", // this needs to be by language
        "levelId": 52,
        "status": "available",
        "points": 0,
        "attempts": 0,
        "completionDate": null
      },
      .....
    ]
  }
}

@vibern0 vibern0 changed the title [LaE] control levels [LaE] control levels/lessons Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants