maps_controller.rb 523 Bytes
Newer Older
hellekin's avatar
hellekin committed
1 2 3 4
# frozen_string_literal: true

class Api::V0::MapsController < ApplicationController
  def index
hellekin's avatar
hellekin committed
5
    @maps = policy_scope(Map).includes(:collection).all
hellekin's avatar
hellekin committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
    render jsonapi: @maps,
           include: include_from_params
  end

  def show
    @map = Map.includes(:collection, :taxonomy).find_by(uuid: params[:id])
    render jsonapi: @map,
           include: include_from_params
  end

  private

  def model_types
    %w(agent collection resources position taxonomy taxonomy.categories taxonomy.sections).freeze
  end
end