You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

17 lines
638 B

module Api
module V1
module Admin
class TrainingWatchHitsController < BaseController
before_action :set_hit, only: %i[show destroy]
def index = render json: TrainingWatchHit.includes(:training_watch_source).order(created_at: :desc).limit(1_000).map { |hit| hit.as_json.merge(source_name: hit.training_watch_source.name) }
def show = render json: @hit.as_json.merge(source_name: @hit.training_watch_source.name)
def destroy
@hit.destroy!
head :no_content
end
private
def set_hit = @hit = TrainingWatchHit.find(params[:id])
end
end
end
end