add private endpoint for match reporting

This commit is contained in:
2026-11-09 23:17:55 +03:00
parent f0616c7c51
commit dcb76fa570
11 changed files with 738 additions and 4 deletions
@@ -0,0 +1,11 @@
# Player-facing match details. Only participants of a match can view it:
# a non-participant (or an unknown uuid) gets 404 to avoid leaking
# information about other players' matches.
class Api::MatchesController < ApplicationController
def show
match = Match.for_user(current_user).find_by(uuid: params[:uuid])
return render json: { error: "Match not found" }, status: :not_found unless match
render json: { match: MatchSerializer.as_json(match, viewer: current_user) }
end
end