@@ -429,7 +429,7 @@ export default function Page() {
429429 useState ( false ) ;
430430
431431 const [ mobileFilterType , setMobileFilterType ] = useState <
432- "category" | "price" | "date" | "options" | null
432+ "category" | "price" | "date" | "options" | "enchant" | null
433433 > ( null ) ;
434434 const [ mobilePriceMin , setMobilePriceMin ] = useState ( "" ) ;
435435 const [ mobilePriceMax , setMobilePriceMax ] = useState ( "" ) ;
@@ -439,6 +439,8 @@ export default function Page() {
439439 const [ mobileActiveFilters , setMobileActiveFilters ] = useState < ActiveFilter [ ] > (
440440 [ ] ,
441441 ) ;
442+ const [ mobileEnchantPrefix , setMobileEnchantPrefix ] = useState < string | null > ( null ) ;
443+ const [ mobileEnchantSuffix , setMobileEnchantSuffix ] = useState < string | null > ( null ) ;
442444
443445 const { data : categories = [ ] , isLoading : isCategoriesLoading } =
444446 useItemCategories ( ) ;
@@ -549,6 +551,8 @@ export default function Page() {
549551 setMobilePriceMax ( parsed . priceSearchRequest ?. priceTo ?. toString ( ) ?? "" ) ;
550552 setMobileDateFrom ( parsed . dateAuctionBuyRequest ?. dateAuctionBuyFrom ?? "" ) ;
551553 setMobileDateTo ( parsed . dateAuctionBuyRequest ?. dateAuctionBuyTo ?? "" ) ;
554+ setMobileEnchantPrefix ( parsed . enchantSearchRequest ?. enchantPrefix ?? null ) ;
555+ setMobileEnchantSuffix ( parsed . enchantSearchRequest ?. enchantSuffix ?? null ) ;
552556 } , [ urlSearchParams ] ) ;
553557
554558 const applyExactItemNameChange = useCallback ( ( value : boolean ) => {
@@ -670,6 +674,12 @@ export default function Page() {
670674 delete next . itemOptionSearchRequest ;
671675 }
672676
677+ if ( filters . enchantSearchRequest ) {
678+ next . enchantSearchRequest = filters . enchantSearchRequest ;
679+ } else {
680+ delete next . enchantSearchRequest ;
681+ }
682+
673683 return normalizeCategorySelection ( next ) ;
674684 } ) ;
675685 // isExactItemName은 SearchFilterCard에서 직접 onExactItemNameChange로 관리
@@ -678,6 +688,8 @@ export default function Page() {
678688 setMobilePriceMax ( filters . priceSearchRequest ?. priceTo ?. toString ( ) ?? "" ) ;
679689 setMobileDateFrom ( filters . dateAuctionBuyRequest ?. dateAuctionBuyFrom ?? "" ) ;
680690 setMobileDateTo ( filters . dateAuctionBuyRequest ?. dateAuctionBuyTo ?? "" ) ;
691+ setMobileEnchantPrefix ( filters . enchantSearchRequest ?. enchantPrefix ?? null ) ;
692+ setMobileEnchantSuffix ( filters . enchantSearchRequest ?. enchantSuffix ?? null ) ;
681693 } ;
682694
683695 const handleMobileFilterApply = ( data : {
@@ -687,6 +699,8 @@ export default function Page() {
687699 dateFrom ?: string ;
688700 dateTo ?: string ;
689701 activeFilters ?: ActiveFilter [ ] ;
702+ enchantPrefix ?: string | null ;
703+ enchantSuffix ?: string | null ;
690704 } ) => {
691705 if ( data . selectedCategory !== undefined ) {
692706 setSelectedCategory ( data . selectedCategory ) ;
@@ -705,6 +719,8 @@ export default function Page() {
705719 if ( data . activeFilters !== undefined ) {
706720 setMobileActiveFilters ( data . activeFilters ) ;
707721 }
722+ if ( data . enchantPrefix !== undefined ) setMobileEnchantPrefix ( data . enchantPrefix ) ;
723+ if ( data . enchantSuffix !== undefined ) setMobileEnchantSuffix ( data . enchantSuffix ) ;
708724
709725 setSearchParams ( ( prev ) => {
710726 const next : AuctionHistorySearchParams = {
@@ -800,6 +816,16 @@ export default function Page() {
800816 delete next . itemOptionSearchRequest ;
801817 }
802818
819+ const enchantPrefixVal = data . enchantPrefix !== undefined ? data . enchantPrefix : mobileEnchantPrefix ;
820+ const enchantSuffixVal = data . enchantSuffix !== undefined ? data . enchantSuffix : mobileEnchantSuffix ;
821+ if ( enchantPrefixVal || enchantSuffixVal ) {
822+ next . enchantSearchRequest = { } ;
823+ if ( enchantPrefixVal ) next . enchantSearchRequest . enchantPrefix = enchantPrefixVal ;
824+ if ( enchantSuffixVal ) next . enchantSearchRequest . enchantSuffix = enchantSuffixVal ;
825+ } else {
826+ delete next . enchantSearchRequest ;
827+ }
828+
803829 return normalizeCategorySelection ( next ) ;
804830 } ) ;
805831 } ;
@@ -859,12 +885,14 @@ export default function Page() {
859885 hasPrice : ! ! ( mobilePriceMin || mobilePriceMax ) ,
860886 hasDate : ! ! ( mobileDateFrom || mobileDateTo ) ,
861887 hasOptions : mobileActiveFilters . length > 0 ,
888+ hasEnchant : ! ! ( mobileEnchantPrefix || mobileEnchantSuffix ) ,
862889 } }
863890 onExactItemNameToggle = { ( ) => handleExactItemNameChange ( ! searchParams . isExactItemName ) }
864891 onCategoryClick = { ( ) => setMobileFilterType ( "category" ) }
865892 onPriceClick = { ( ) => setMobileFilterType ( "price" ) }
866893 onDateClick = { ( ) => setMobileFilterType ( "date" ) }
867894 onOptionsClick = { ( ) => setMobileFilterType ( "options" ) }
895+ onEnchantClick = { ( ) => setMobileFilterType ( "enchant" ) }
868896 />
869897 </ div >
870898 ) }
@@ -1009,6 +1037,8 @@ export default function Page() {
10091037 dateFrom : mobileDateFrom ,
10101038 dateTo : mobileDateTo ,
10111039 activeFilters : mobileActiveFilters ,
1040+ enchantPrefix : mobileEnchantPrefix ,
1041+ enchantSuffix : mobileEnchantSuffix ,
10121042 } }
10131043 categories = { categories }
10141044 onApply = { handleMobileFilterApply }
0 commit comments