diff --git a/src/components/project/client-brief/add-images-modal/AddImagesModal.vue b/src/components/project/client-brief/add-images-modal/AddImagesModal.vue index 899b812..f77345a 100644 --- a/src/components/project/client-brief/add-images-modal/AddImagesModal.vue +++ b/src/components/project/client-brief/add-images-modal/AddImagesModal.vue @@ -28,7 +28,7 @@ diff --git a/src/components/project/client-brief/add-images-modal/ImagesResources.vue b/src/components/project/client-brief/add-images-modal/ImagesResources.vue index 0c4ee65..1b742fe 100644 --- a/src/components/project/client-brief/add-images-modal/ImagesResources.vue +++ b/src/components/project/client-brief/add-images-modal/ImagesResources.vue @@ -28,10 +28,13 @@ import { useAddImagesModalStore } from "../../../../stores/addImagesModal"; import { computed } from "vue"; import ArrayUtils from "../../../../utils/array"; +const { id } = defineProps({ + id: String, +}); const { tabs } = storeToRefs(useAddImagesModalStore()); const tab = computed(() => { - return tabs.value.find((tab) => tab.id === "materials"); + return tabs.value.find((tab) => tab.id === id); }); function isSelected(image) { diff --git a/src/stores/addImagesModal.js b/src/stores/addImagesModal.js index c8cbcc4..574b058 100644 --- a/src/stores/addImagesModal.js +++ b/src/stores/addImagesModal.js @@ -58,9 +58,9 @@ export const useAddImagesModalStore = defineStore("add-images-modal", () => { .fetchPageData("materials") .then((json) => (images.value = tabs.value[1].images = json.images)); - api - .fetchPageData("creations") - .then((json) => (images.value = tabs.value[2].images = json.images)); + api.fetchPageData("creations").then((json) => { + images.value = tabs.value[2].images = json.images; + }); return { images, activeTabId, tabs, activeTab }; });