fix: select for languages

This commit is contained in:
2026-04-02 08:52:29 +02:00
parent 272c6066fb
commit d0c055a819
3 changed files with 16 additions and 29 deletions

View File

@@ -29,15 +29,15 @@ export const useProductStore = defineStore('product', () => {
const error = ref<string | null>(null)
const productDescription = ref()
async function getProductDescription(langId: number, productID: number) {
async function getProductDescription(langId: number | null, productID: number) {
loading.value = true
error.value = null
try {
const response = await useFetchJson<ProductDescription>(
`/api/v1/restricted/product-translation/get-product-description?productID=${productID}&productLangID=${langId}`
`/api/v1/restricted/product-translation/get-product-description?productID=${productID}&productLangID=${langId ? langId : settingStore.shopDefaultLanguage}`
)
productDescription.value = response.items
} catch (e: unknown) {
error.value = e instanceof Error ? e.message : 'Failed to load product description'
} finally {