Skip to content

Commit

Permalink
update search
Browse files Browse the repository at this point in the history
  • Loading branch information
BuJlJlu committed Oct 11, 2024
1 parent b07948c commit 7b127a4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 44 deletions.
2 changes: 2 additions & 0 deletions api/other.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ export const updateVisit = (slug) => {
method: 'POST'
})
}
export const getListSearch = () =>
$fetch('https://newapi.mixdrinks.org/api/cocktails/all')
5 changes: 2 additions & 3 deletions components/UI/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import {
onUpdated,
onMounted
} from 'vue'
import { getListSearch } from '~~/api/other'
import { useRoute } from 'nuxt/app'
import { pages } from '../../utils/pages'
Expand All @@ -73,9 +74,7 @@ export default defineComponent({
const removeFocus = () => (focusInput.value = false)
async function setListSearch() {
listSearch.value = await $fetch(
`https://newapi.mixdrinks.org/api/cocktails/all`
)
listSearch.value = await getListSearch()
}
const height = computed(() => {
Expand Down
42 changes: 1 addition & 41 deletions pages/blog/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default defineComponent({
const tags = computed(() =>
unref(post).tags.map((tag) => ({
name: tag.name,
url: `${pages.blog.slug}/t/${tag.slug}`
url: `${pages.blog.slug}/${pages.blog.tag}/${tag.slug}`
}))
)
Expand All @@ -73,46 +73,6 @@ export default defineComponent({
breadCrumbs
}
}
// head() {
// return {
// title: this.title,
// link: [{ rel: 'canonical', href: this.canonical }],
// meta: [
// {
// hid: 'description',
// name: 'description',
// content: this.description,
// },
// {
// hid: 'og:title',
// name: 'og:title',
// content: this.title,
// },
// {
// hid: 'og:description',
// property: 'og:description',
// content: this.description,
// },
// {
// hid: 'og:url',
// property: 'og:url',
// content: `${this.canonical}`,
// },
// {
// hid: 'og:image',
// property: 'og:image',
// content: `${this.post.meta.ogImage}`,
// },
// ],
// }
// },
// mounted() {
// this.$axios.post(`/post/${this.post.slug}/visit`, {
// withCredentials: true,
// })
// },
})
</script>

Expand Down
3 changes: 3 additions & 0 deletions utils/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ export const pages = {
},
privacy: {
slug: 'privacy'
},
tag: {
slug: 't'
}
}

0 comments on commit 7b127a4

Please sign in to comment.