hensei-api/app/controllers/api/v1/phantom_claims_controller.rb
Justin Edmund de72d21e24 add decline/pending endpoints for phantom claims
- decline_claim action lets assigned user reject assignment
- pending_phantom_claims endpoint for user's pending claims
- with_crew blueprint view for phantom claims context
2025-12-17 18:28:23 -08:00

20 lines
601 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
.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