Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Searched word not applied as filter after clicking see all #10986

Merged
merged 7 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 8 additions & 31 deletions components/search/SearchSuggestion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,11 @@
class="search-footer-link"
:to="{
path: `/${urlPrefix}/explore/collectibles`,
query: { ...$route.query },
query: { ...$route.query, search: name },
}"
@click="close"
>
<div
:class="loadMoreItemClassName"
@click="seeAllButtonHandler"
>
<div :class="loadMoreItemClassName">
{{ $t('search.seeAll') }}
<svg
class="ml-1"
Expand Down Expand Up @@ -173,13 +171,11 @@
class="search-footer-link"
:to="{
path: `/${urlPrefix}/explore/items`,
query: { ...$route.query },
query: { ...$route.query, search: name },
}"
@click="close"
>
<div
:class="loadMoreItemClassName"
@click="seeAllButtonHandler"
>
<div :class="loadMoreItemClassName">
{{ $t('search.seeAll') }}
<svg
class="ml-1"
Expand Down Expand Up @@ -323,6 +319,7 @@ import resolveQueryPath from '@/utils/queryPathResolver'
import { unwrapSafe } from '@/utils/uniquery'
import Money from '@/components/shared/format/Money.vue'

const emit = defineEmits(['close', 'gotoGallery'])
const props = defineProps({
name: {
type: String,
Expand Down Expand Up @@ -416,29 +413,9 @@ const selectedItemListMap = computed(() => ({
}))

const router = useRouter()
const route = useRoute()
const { $consola } = useNuxtApp()

const updateSearchUrl = () => {
const { name } = props
if (name) {
router
.replace({
path: String(route.path),
query: {
search: name,
},
})
.catch($consola.warn)
}
}

const emit = defineEmits(['close', 'gotoGallery'])

const seeAllButtonHandler = () => {
emit('close')
updateSearchUrl()
}
const close = () => emit('close')

const nativeSearch = () => {
// not selected
Expand Down
7 changes: 6 additions & 1 deletion pages/[prefix]/explore/items.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ definePageMeta({
middleware: [
function (to) {
if (to.query.listed === undefined) {
return navigateTo({ path: to.path, query: { listed: true } })
return navigateTo({
path: to.path,
query: {
...to.query,
listed: 'true',
} })
}
},
],
Expand Down
Loading