leaderboardsgg / leaderboard-backend

The backend for Leaderboards.gg. Also holds public-facing APIs.
https://info.leaderboards.gg
GNU General Public License v3.0
12 stars 16 forks source link

Delete Leaderboard Endpoint #231

Closed TheTedder closed 1 month ago

TheTedder commented 3 months ago

DELETE /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 server must return a 404 error if the given ID corresponds to a leaderboard that is already deleted.

The server may use a response body to disambiguate between the two different scenarios that can generate a 404 error.

Upon a successful deletion, the server must set the DeletedAt field of the corresponding leaderboard to the current time and return a 204 status code.