From c4529f75dfc3bda7c50777ff06bf069f4c154568 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Thu, 28 Sep 2023 09:31:32 +0200 Subject: [PATCH] Improve imports from code review Co-authored-by: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> --- client/src/stores/collectionAttributesStore.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/src/stores/collectionAttributesStore.ts b/client/src/stores/collectionAttributesStore.ts index dd2c86265690..96b31d0c03da 100644 --- a/client/src/stores/collectionAttributesStore.ts +++ b/client/src/stores/collectionAttributesStore.ts @@ -1,8 +1,8 @@ import { defineStore } from "pinia"; -import Vue, { computed, ref } from "vue"; +import { computed, del, ref, set } from "vue"; import { DatasetCollectionAttributes } from "./services"; -import * as Service from "./services/datasetCollection.service"; +import { fetchCollectionAttributes } from "./services/datasetCollection.service"; export const useCollectionAttributesStore = defineStore("collectionAttributesStore", () => { const storedAttributes = ref<{ [key: string]: DatasetCollectionAttributes }>({}); @@ -11,7 +11,7 @@ export const useCollectionAttributesStore = defineStore("collectionAttributesSto const getAttributes = computed(() => { return (hdcaId: string) => { if (!storedAttributes.value[hdcaId]) { - Vue.set(storedAttributes.value, hdcaId, {}); + set(storedAttributes.value, hdcaId, {}); fetchAttributes({ hdcaId }); } return storedAttributes.value[hdcaId]; @@ -25,13 +25,13 @@ export const useCollectionAttributesStore = defineStore("collectionAttributesSto }); async function fetchAttributes(params: { hdcaId: string }) { - Vue.set(loadingAttributes.value, params.hdcaId, true); + set(loadingAttributes.value, params.hdcaId, true); try { - const attributes = await Service.fetchCollectionAttributes(params); - Vue.set(storedAttributes.value, params.hdcaId, attributes); + const attributes = await fetchCollectionAttributes(params); + set(storedAttributes.value, params.hdcaId, attributes); return attributes; } finally { - Vue.delete(loadingAttributes.value, params.hdcaId); + del(loadingAttributes.value, params.hdcaId); } }