From af2afd0d4e7412e5d97f1085d94ecf0defaa9a21 Mon Sep 17 00:00:00 2001 From: ian Date: Wed, 18 Jan 2023 15:21:41 +0800 Subject: [PATCH] Fix fetching from related collection in drawer item (#17210) --- app/src/views/private/components/drawer-item.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/views/private/components/drawer-item.vue b/app/src/views/private/components/drawer-item.vue index f446db8a03..a3c299b982 100644 --- a/app/src/views/private/components/drawer-item.vue +++ b/app/src/views/private/components/drawer-item.vue @@ -270,7 +270,6 @@ function useItem() { const internalEdits = ref>({}); const loading = ref(false); const initialValues = ref | null>(null); - const baseEndpoint = getEndpoint(props.collection); watch( () => props.active, @@ -295,6 +294,7 @@ function useItem() { loading.value = true; + const baseEndpoint = getEndpoint(props.collection); const endpoint = props.collection.startsWith('directus_') ? `${baseEndpoint}/${props.primaryKey}` : `${baseEndpoint}/${encodeURIComponent(props.primaryKey)}`; @@ -323,6 +323,7 @@ function useItem() { loading.value = true; + const baseEndpoint = getEndpoint(collection); const endpoint = collection.startsWith('directus_') ? `${baseEndpoint}/${props.relatedPrimaryKey}` : `${baseEndpoint}/${encodeURIComponent(props.relatedPrimaryKey)}`;