From 6d51033d0e220c3aba12ce4edcdb7cf0b17b3d48 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Thu, 6 Jul 2023 17:10:18 -0700 Subject: [PATCH] Fix summon update_uncap_level (#119) * Remove ap call * Fix remix render method * Downcase username on db end There was a bug where users with capital letters in their name could not access their profiles after we tried to make things case insensitive. * Remove ap call and unused code * Add granblue.team to cors This works now! * Implement all-entity search to support tagging objects (#117) * Add table for multisearch * Add new route for searching all entities * Make models multisearchable We're going to start with Character, Summon, Weapon and Jobs * Add method to Search controller This will search with trigram first, and then if there aren't enough results, search with prefixed text search * Add support for Japanese all-entity search * Update grid_summons_controller.rb Set the proper uncap level for transcended summons --- app/controllers/api/v1/grid_summons_controller.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/controllers/api/v1/grid_summons_controller.rb b/app/controllers/api/v1/grid_summons_controller.rb index 156fcd6..d4a6416 100644 --- a/app/controllers/api/v1/grid_summons_controller.rb +++ b/app/controllers/api/v1/grid_summons_controller.rb @@ -32,16 +32,18 @@ module Api def update_uncap_level summon = @summon.summon - max_uncap_level = if summon.flb && !summon.ulb + max_uncap_level = if summon.flb && !summon.ulb && !summon.xlb 4 - elsif summon.ulb + elsif summon.ulb && !summon.xlb 5 + elsif summon.xlb + 6 else 3 end greater_than_max_uncap = summon_params[:uncap_level].to_i > max_uncap_level - can_be_transcended = summon.xlb && summon_params[:transcendence_step] && summon_params[:transcendence_step]&.to_i.positive? + can_be_transcended = summon.xlb && summon_params[:transcendence_step] && summon_params[:transcendence_step]&.to_i&.positive? uncap_level = if greater_than_max_uncap || can_be_transcended max_uncap_level @@ -130,8 +132,8 @@ module Api def render_grid_summon_view(grid_summon, conflict_position = nil) GridSummonBlueprint.render(grid_summon, view: :nested, - root: :grid_summon, - meta: { replaced: conflict_position }) + root: :grid_summon, + meta: { replaced: conflict_position }) end def authorize