class Api::MatchmakingController < ApplicationController # Explicit cancellation. Normally the search is cancelled automatically # when the MatchmakingChannel subscription is closed. def destroy MatchmakingService.cancel(current_user.id) render json: { message: "Matchmaking cancelled" } end end