fix: style
This commit is contained in:
@@ -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
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user