From a2ac1ee1b005ef1655f0e8813c3c19e2b778f7c1 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 5 Jul 2023 18:44:17 -0700 Subject: [PATCH] Add new route for searching all entities --- app/blueprints/api/v1/search_blueprint.rb | 10 ++++++++++ config/routes.rb | 1 + 2 files changed, 11 insertions(+) create mode 100644 app/blueprints/api/v1/search_blueprint.rb diff --git a/app/blueprints/api/v1/search_blueprint.rb b/app/blueprints/api/v1/search_blueprint.rb new file mode 100644 index 0000000..f80531b --- /dev/null +++ b/app/blueprints/api/v1/search_blueprint.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Api + module V1 + class SearchBlueprint < Blueprinter::Base + identifier :searchable_id + fields :searchable_type, :granblue_id, :name_en, :name_jp, :element + end + end +end diff --git a/config/routes.rb b/config/routes.rb index 5864e34..9e13ee8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -31,6 +31,7 @@ Rails.application.routes.draw do post 'check/email', to: 'users#check_email' post 'check/username', to: 'users#check_username' + post 'search', to: 'search#all' post 'search/characters', to: 'search#characters' post 'search/weapons', to: 'search#weapons' post 'search/summons', to: 'search#summons'