remove related products fetch from ProductCard
This commit is contained in:
@@ -57,7 +57,6 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.productUrl = window.location.origin + `/productos/${this.product.id}`
|
this.productUrl = window.location.origin + `/productos/${this.product.id}`
|
||||||
this.getRelatedProducts()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@@ -72,21 +71,6 @@ export default {
|
|||||||
tagRoute(tag) {
|
tagRoute(tag) {
|
||||||
return `/busqueda?tags=${tag}`
|
return `/busqueda?tags=${tag}`
|
||||||
},
|
},
|
||||||
async getRelatedProducts() {
|
|
||||||
try {
|
|
||||||
const config = useRuntimeConfig()
|
|
||||||
const data = await $fetch(`/products/${this.product.id}/related/`, {
|
|
||||||
baseURL: config.public.baseURL,
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Authorization: '/',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
this.relatedProducts = data
|
|
||||||
} catch {
|
|
||||||
this.relatedProducts = null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
openUrl(url) {
|
openUrl(url) {
|
||||||
window.open(url)
|
window.open(url)
|
||||||
|
|||||||
Reference in New Issue
Block a user