Skip to content

As a user, I would like to update my game play information #3

@RyanFrantz

Description

@RyanFrantz

This story depends on #4.

As a user, given a valid JWT (see Implementation Notes, below), I should be able to submit a request to /users/:id/games and post game play information.

Acceptance Criteria:

  • Get current game counts for a user curl -H 'Authorization: Bearer <token>' localhost:8080/user/1/games
  • Update the count for one of the games: curl -H 'Authorization: Bearer <token>' -X POST localhost:8080/user/1/games/train-of-thought (see 2nd implementation note)
  • See that the play count has increased by 1 curl -H 'Authorization: Bearer <token>' localhost:8080/user/1/games

Implementation Notes:

  • A valid JWT can be generated via the gen-token.js script at the root of this project.
  • If the user does not exist in the database (src/data.js), it should be automatically created, since we fully trust the JWT as authentic 😉
  • Should have basic validation (e.g. the given game slug exists, etc)
  • The final route and payload to POST to is up to the implementer (and we will update the Acceptance Criteria to match)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions