hensei-api/app/controllers/api/v1/phantom_claims_controller.rb
Justin Edmund 5afd31fdb6 soft delete phantoms after claim confirmation
keeps phantom records for logging, excludes from all queries
2025-12-17 20:08:28 -08:00

21 lines
624 B
Ruby

# frozen_string_literal: true
module Api
module V1
class PhantomClaimsController < Api::V1::ApiController
before_action :restrict_access
# GET /pending_phantom_claims
# Returns phantom players assigned to the current user that are pending confirmation
def index
phantoms = PhantomPlayer
.not_deleted
.includes(:crew, :claimed_by)
.where(claimed_by: current_user, claim_confirmed: false)
.order(created_at: :desc)
render json: PhantomPlayerBlueprint.render(phantoms, view: :with_crew, root: :phantom_claims)
end
end
end
end