standardize links format in blueprints
return wiki: {en, ja} + gamewith, kamigame at top level
This commit is contained in:
parent
056aa3676f
commit
b91ef0a4dd
3 changed files with 17 additions and 18 deletions
|
|
@ -11,8 +11,7 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
fields :granblue_id, :character_id, :rarity,
|
fields :granblue_id, :character_id, :rarity,
|
||||||
:element, :gender, :special, :season,
|
:element, :gender, :special, :season
|
||||||
:gacha_available
|
|
||||||
|
|
||||||
field :season_name do |c|
|
field :season_name do |c|
|
||||||
c.season_name
|
c.season_name
|
||||||
|
|
@ -74,14 +73,14 @@ module Api
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
field :links do |c|
|
field :wiki do |c|
|
||||||
{
|
{
|
||||||
wiki_en: c.wiki_en,
|
en: c.wiki_en,
|
||||||
wiki_ja: c.wiki_ja,
|
ja: c.wiki_ja
|
||||||
gamewith: c.gamewith,
|
|
||||||
kamigame: c.kamigame
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
fields :gamewith, :kamigame
|
||||||
end
|
end
|
||||||
|
|
||||||
# Separate view for recruitment info - only include when needed (e.g., character detail page)
|
# Separate view for recruitment info - only include when needed (e.g., character detail page)
|
||||||
|
|
|
||||||
|
|
@ -77,14 +77,14 @@ module Api
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
field :links do |s|
|
field :wiki do |s|
|
||||||
{
|
{
|
||||||
wiki_en: s.wiki_en,
|
en: s.wiki_en,
|
||||||
wiki_ja: s.wiki_ja,
|
ja: s.wiki_ja
|
||||||
gamewith: s.gamewith,
|
|
||||||
kamigame: s.kamigame
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
fields :gamewith, :kamigame
|
||||||
end
|
end
|
||||||
|
|
||||||
# Separate view for raw data - only used by dedicated endpoint
|
# Separate view for raw data - only used by dedicated endpoint
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ module Api
|
||||||
# Primary information
|
# Primary information
|
||||||
fields :granblue_id, :element, :proficiency,
|
fields :granblue_id, :element, :proficiency,
|
||||||
:max_level, :max_skill_level, :max_awakening_level, :limit, :rarity,
|
:max_level, :max_skill_level, :max_awakening_level, :limit, :rarity,
|
||||||
:ax, :ax_type, :promotions
|
:ax, :ax_type, :gacha, :promotions
|
||||||
|
|
||||||
# Series - returns full object with flags if weapon_series is present, fallback to legacy integer
|
# Series - returns full object with flags if weapon_series is present, fallback to legacy integer
|
||||||
field :series do |w|
|
field :series do |w|
|
||||||
|
|
@ -91,15 +91,15 @@ module Api
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
field :links do |w|
|
field :wiki do |w|
|
||||||
{
|
{
|
||||||
wiki_en: w.wiki_en,
|
en: w.wiki_en,
|
||||||
wiki_ja: w.wiki_ja,
|
ja: w.wiki_ja
|
||||||
gamewith: w.gamewith,
|
|
||||||
kamigame: w.kamigame
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
fields :gamewith, :kamigame
|
||||||
|
|
||||||
field :recruits do |w|
|
field :recruits do |w|
|
||||||
next nil unless w.recruits.present?
|
next nil unless w.recruits.present?
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue