mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 21:28:06 +00:00
refactor: 将 enum key的格式改为 PascalCase
This commit is contained in:
parent
0061a66124
commit
7e892997bd
36 changed files with 141 additions and 142 deletions
|
|
@ -69,15 +69,15 @@ const Albums = ({ albums }: { albums: Album[] }) => {
|
|||
}
|
||||
|
||||
const Search = () => {
|
||||
const { keywords = '', type = 'ALL' } = useParams()
|
||||
const { keywords = '', type = 'all' } = useParams()
|
||||
|
||||
const searchType: keyof typeof SearchTypes =
|
||||
type.toUpperCase() in SearchTypes
|
||||
? (type.toUpperCase() as keyof typeof SearchTypes)
|
||||
: 'ALL'
|
||||
: 'All'
|
||||
|
||||
const { data: bestMatchRaw, isLoading: isLoadingBestMatch } = useQuery(
|
||||
[SearchApiNames.MULTI_MATCH_SEARCH, keywords],
|
||||
[SearchApiNames.MultiMatchSearch, keywords],
|
||||
() => multiMatchSearch({ keywords })
|
||||
)
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ const Search = () => {
|
|||
}, [bestMatchRaw?.result])
|
||||
|
||||
const { data: searchResult, isLoading: isLoadingSearchResult } = useQuery(
|
||||
[SearchApiNames.SEARCH, keywords, searchType],
|
||||
[SearchApiNames.Search, keywords, searchType],
|
||||
() => search({ keywords, type: searchType })
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue