Add raids#show

This commit is contained in:
Justin Edmund 2024-02-21 23:23:47 -05:00
parent 6809030b5a
commit 423748da36
2 changed files with 6 additions and 0 deletions

View file

@ -7,6 +7,11 @@ module Api
render json: RaidBlueprint.render(Raid.all, view: :full) render json: RaidBlueprint.render(Raid.all, view: :full)
end end
def show
raid = Raid.find_by(slug: params[:id])
render json: RaidBlueprint.render(Raid.find_by(slug: params[:id]), view: :full) if raid
end
def groups def groups
render json: RaidGroupBlueprint.render(RaidGroup.all, view: :full) render json: RaidGroupBlueprint.render(RaidGroup.all, view: :full)
end end

View file

@ -48,6 +48,7 @@ Rails.application.routes.draw do
get 'raids', to: 'raids#all' get 'raids', to: 'raids#all'
get 'raids/groups', to: 'raids#groups' get 'raids/groups', to: 'raids#groups'
get 'raids/:id', to: 'raids#show'
get 'weapon_keys', to: 'weapon_keys#all' get 'weapon_keys', to: 'weapon_keys#all'
post 'characters', to: 'grid_characters#create' post 'characters', to: 'grid_characters#create'