diff --git a/bo/src/stores/product.ts b/bo/src/stores/product.ts index 5b23bd3..f4da339 100644 --- a/bo/src/stores/product.ts +++ b/bo/src/stores/product.ts @@ -42,6 +42,22 @@ export const useProductStore = defineStore('product', () => { loading.value = false } } + + async function getProductDescriptionTranslations() { + loading.value = true + error.value = null + + try { + const response = await useFetchJson('api/v1/restricted/product-description/translate-product-description?productID=51&productShopID=1&productFromLangID=1&productToLangID=2') + productDescription.value = response + } catch (e: any) { + error.value = e?.message || 'Failed to load product description' + console.error('Failed to fetch product description:', e) + } finally { + loading.value = false + } + } + // Fetch single product by ID async function fetchProductById(id: number) { loading.value = true @@ -102,6 +118,7 @@ export const useProductStore = defineStore('product', () => { getProductDescription, fetchProductById, clearCurrentProduct, - saveProductDescription + saveProductDescription, + getProductDescriptionTranslations } }) diff --git a/bo/src/views/customer/ProductDetailView.vue b/bo/src/views/customer/ProductDetailView.vue index 475c599..adefb9a 100644 --- a/bo/src/views/customer/ProductDetailView.vue +++ b/bo/src/views/customer/ProductDetailView.vue @@ -1,5 +1,7 @@