Просмотр исходного кода

refactor: hardcode library.search as default action in search-input component

All callers passed the same route, so moving it into the component
default removes the redundancy and centralises future maintenance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
visuddhinanda 5 дней назад
Родитель
Сommit
e1846d169d

+ 1 - 1
api-v13/resources/views/components/ui/search-input.blade.php

@@ -1,6 +1,6 @@
 {{-- resources/views/components/ui/search-input.blade.php --}}
 @props([
-'action',
+'action' => route('library.search'),
 'value' => '',
 'placeholder' => '搜索…',
 'buttonText' => '搜索',

+ 0 - 1
api-v13/resources/views/library/anthology/index.blade.php

@@ -54,7 +54,6 @@
                 {{-- 搜索 --}}
                 <div class="sb-card" style="padding: .85rem 1.1rem; margin-bottom: 1.1rem;">
                     <x-ui.search-input
-                        :action="route('library.search')"
                         :placeholder="__('library.search_anthology')"
                         :hidden-fields="['resource_type' => 'anthology']" />
                 </div>

+ 0 - 1
api-v13/resources/views/library/index.blade.php

@@ -20,7 +20,6 @@
         <p class="hero-subtitle">{{ __('library.portal_hero_subtitle') }}</p>
         <div class="search-box">
             <x-ui.search-input
-                :action="route('library.search')"
                 :placeholder="__('library.search_placeholder_home')"
                 size="lg" />
         </div>

+ 0 - 1
api-v13/resources/views/library/search.blade.php

@@ -14,7 +14,6 @@
 {{-- 搜索框 --}}
 <div class="wiki-search-bar-wrap">
     <x-ui.search-input
-        :action="route('library.search')"
         :value="$query"
         :placeholder="__('library.search_placeholder')"
         :autofocus="true"

+ 0 - 1
api-v13/resources/views/library/tipitaka/category.blade.php

@@ -72,7 +72,6 @@
             {{-- 搜索框 --}}
             <div>
                 <x-ui.search-input
-                    :action="route('library.search')"
                     :value="request('q')"
                     :placeholder="__('library.search_tipitaka')"
                     :hidden-fields="['resource_type' => 'tipitaka']" />

+ 0 - 1
api-v13/resources/views/library/tipitaka/index.blade.php

@@ -14,7 +14,6 @@
         <p class="hero-subtitle">{{ __('library.portal_hero_subtitle') }}</p>
         <div class="search-box">
             <x-ui.search-input
-                :action="route('library.search')"
                 :placeholder="__('library.search_tipitaka')"
                 size="lg"
             />

+ 0 - 1
api-v13/resources/views/library/wiki/home.blade.php

@@ -26,7 +26,6 @@
     {{-- 搜索框 --}}
     <div class="wiki-home-search">
         <x-ui.search-input
-            :action="route('library.search')"
             :value="request('q')"
             :placeholder="__('library.wiki_search_placeholder')"
             size="lg"

+ 0 - 1
api-v13/resources/views/library/wiki/index.blade.php

@@ -7,7 +7,6 @@
 {{-- 搜索框组件 --}}
 <div class="wiki-search-wrapper">
     <x-ui.search-input
-        :action="route('library.search')"
         :value="request('q')"
         :placeholder="__('library.wiki_search_placeholder')"
         size="lg"

+ 0 - 1
api-v13/resources/views/library/wiki/show.blade.php

@@ -7,7 +7,6 @@
 {{-- 搜索框组件 --}}
 <div class="wiki-search-wrapper">
     <x-ui.search-input
-        :action="route('library.search')"
         :value="request('q')"
         :placeholder="__('library.wiki_search_placeholder')"
         size="lg"