#40 feat: add catalogue images CRUD and display in product catalog
This commit is contained in:
10
src/pages/admin/catalogue-images.vue
Normal file
10
src/pages/admin/catalogue-images.vue
Normal file
@@ -0,0 +1,10 @@
|
||||
<template>
|
||||
<CatalogueImagesManagement v-if="authStore.isAdmin" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
import CatalogueImagesManagement from '@/components/CatalogueImagesManagement.vue';
|
||||
|
||||
const authStore = useAuthStore();
|
||||
</script>
|
||||
@@ -379,7 +379,7 @@ export default {
|
||||
this.items = data.map((product) => ({
|
||||
...product,
|
||||
quantity: 0,
|
||||
img: product.img || not_image_product,
|
||||
img: (product.catalogue_images?.length > 0) ? product.catalogue_images[0] : (product.img || not_image_product),
|
||||
}));
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
Reference in New Issue
Block a user