Add route to get all raids

This commit is contained in:
Justin Edmund 2022-02-23 19:04:34 -08:00
parent 3cb18aa8ef
commit edf489ce31
4 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,6 @@
class Api::V1::RaidsController < Api::V1::ApiController
def all
@raids = Raid.all()
render :all, status: :ok
end
end

View file

@ -0,0 +1,3 @@
collection @raids
extends 'raids/base'

View file

@ -0,0 +1,10 @@
object :raid
attributes :id, :level, :group
node :name do |r|
{
:en => r.name_en,
:jp => r.name_jp
}
end

View file

@ -20,6 +20,8 @@ Rails.application.routes.draw do
get 'search/weapons', to: 'search#weapons'
get 'search/summons', to: 'search#summons'
get 'raids', to: 'raids#all'
post 'characters', to: 'grid_characters#create'
post 'characters/update_uncap', to: 'grid_characters#update_uncap_level'
delete 'characters', to: 'grid_characters#destroy'