From c2e4708038bfc4e3466de4683f503beabfd1b5fa Mon Sep 17 00:00:00 2001 From: Csaky Date: Thu, 1 Feb 2024 09:41:18 -0800 Subject: [PATCH] Optimize - only fetch bucket name when in fullview --- .../src/components/object/ObjectProperties.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/object/ObjectProperties.vue b/frontend/src/components/object/ObjectProperties.vue index 128248d4..ce7c065c 100644 --- a/frontend/src/components/object/ObjectProperties.vue +++ b/frontend/src/components/object/ObjectProperties.vue @@ -13,12 +13,14 @@ import type { Bucket, COMSObject, Metadata } from '@/types'; // Props type Props = { objectId: string; - versionId?: string; + // versionId?: string; + bucketName: string; fullView: boolean; }; const props = withDefaults(defineProps(), { - versionId: undefined + // versionId: undefined + // bucketName: undefined }); // Store @@ -38,11 +40,14 @@ const updatedBy: Ref = ref(undefined); // Actions async function load() { object.value = objectStore.findObjectById(props.objectId); - await bucketStore.fetchBuckets({ bucketId: object.value?.bucketId }); - bucket.value = bucketStore.findBucketById(object.value?.bucketId as string); if (props.fullView) { - objectMetadata.value = metadataStore.findMetadataByObjectId(object.value?.id as string); + // get populate bucket + await bucketStore.fetchBuckets({ bucketId: object.value?.bucketId }); + bucket.value = bucketStore.findBucketById(object.value?.bucketId as string); + + // objectMetadata.value = metadataStore.findMetadataByObjectId(object.value?.id as string); + await userStore.fetchUsers({ userId: [object.value?.createdBy, object.value?.updatedBy] }); createdBy.value = getUserSearch.value.find((x) => x.userId === object.value?.createdBy)?.fullName; updatedBy.value = getUserSearch.value.find((x) => x.userId === object.value?.updatedBy)?.fullName;