From b04f688cb9cf7724c2fdf8adad9443bc9e1dbb8f Mon Sep 17 00:00:00 2001 From: Per-Kristian Nordnes Date: Thu, 30 Jan 2025 16:04:50 +0100 Subject: [PATCH] refactor(core): globalDocumentReference format to use ':' instead of '/' --- .../GlobalDocumentReferenceInput.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sanity/src/core/form/inputs/GlobalDocumentReferenceInput/GlobalDocumentReferenceInput.tsx b/packages/sanity/src/core/form/inputs/GlobalDocumentReferenceInput/GlobalDocumentReferenceInput.tsx index 2485d7e7b04..36afc0daad6 100644 --- a/packages/sanity/src/core/form/inputs/GlobalDocumentReferenceInput/GlobalDocumentReferenceInput.tsx +++ b/packages/sanity/src/core/form/inputs/GlobalDocumentReferenceInput/GlobalDocumentReferenceInput.tsx @@ -95,7 +95,7 @@ export function GlobalDocumentReferenceInput(props: GlobalDocumentReferenceInput onChange( set({ _type: schemaType.name, - _ref: `${schemaType.resourceType}/${schemaType.resourceId}/${getPublishedId(id)}`, + _ref: `${schemaType.resourceType}:${schemaType.resourceId}:${getPublishedId(id)}`, _weak: schemaType.weak, // persist _key between mutations if the value is in an array _key: value?._key, @@ -139,7 +139,7 @@ export function GlobalDocumentReferenceInput(props: GlobalDocumentReferenceInput return null } - const [, , _id] = value._ref.split('/', 3) + const [, , _id] = value._ref.split(':', 3) return {_id} }, [value])