Skip to content

Commit 466baae

Browse files
committed
fix: optimize contact query by enabling it only when contactId is available
1 parent 1ff183c commit 466baae

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

frontend/src/views/Dashboard/Members/MemberView.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,8 @@ const contactId = computed(
225225
226226
const { data: contact, isLoading: contactLoading } = useQuery({
227227
key: () => ["member-contact", contactId.value || ""],
228-
query: () => {
229-
if (!contactId.value) return Promise.resolve({ data: null });
230-
return instance.get(`/contacts/${contactId.value}`);
231-
},
228+
enabled: () => !!contactId.value,
229+
query: () => instance.get(`/contacts/${contactId.value}`),
232230
});
233231
234232
const companiesFilters = computed(() => ({

0 commit comments

Comments
 (0)