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

Update Leaderboard Endpoint #236

Closed
Tracked by #238
TheTedder opened this issue Aug 19, 2024 · 0 comments · Fixed by #256
Closed
Tracked by #238

Update Leaderboard Endpoint #236

TheTedder opened this issue Aug 19, 2024 · 0 comments · Fixed by #256
Assignees
Labels
enhancement New feature or request high priority
Milestone

Comments

@TheTedder
Copy link
Contributor

TheTedder commented Aug 19, 2024

PATCH /leaderboard/{id} where id is a long.

The server must return a 401 error if the client is not authenticated.

The server must return a 403 error if the current user's role is not ADMIN.

The server must return a 404 error if the given ID does not correspond to a leaderboard in the database.

The endpoint accepts a JSON request body containing an object that must contain one or several of the following fields:

  • Name: string
  • Slug: string
  • Info: string

If the request body does not contain at least one of the above fields, the server must return a 422 error.

The server must return a 409 error if the provided slug is already in use by a non-deleted leaderboard and the server must not update any of the leaderboard's fields.

The server returns a 422 error if

  • slug is not between 2 and 80 characters inclusive.
  • the slug is not comprised solely of alphanumeric digits, hyphens, and underscores.

Upon a successful request, the specified fields of the leaderboard with ID id must be updated to the supplied values in the database, the leaderboard's UpdatedAt field must be set to the current time, and a 204 status code must be returned.

None of the leaderboard's fields other than the ones specified above may be accepted.

@TheTedder TheTedder added enhancement New feature or request high priority labels Aug 19, 2024
@TheTedder TheTedder added this to the MVP milestone Aug 19, 2024
@TheTedder TheTedder self-assigned this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant