Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
123456789101112131415161718192021class Api::V3::Users::PbsController < Api::V3::ApplicationController before_action :set_user before_action :set_pbs, only: [:index]
def index render json: Api::V3::RunBlueprint.render(@pbs, root: :pbs) end
private
def set_user @user = User.find_by(name: params[:user_id]) || User.find(params[:user_id]) rescue ActiveRecord::RecordNotFound render status: :not_found, json: {status: 404, message: "User with name or id '#{params[:user_id]}' not found."} end
def set_pbs @pbs = @user.pbs.includes(:game, :category) endend