From d6e75849670d0c00762802e9fcfc98c86ace9eff Mon Sep 17 00:00:00 2001 From: Robin Pyon Date: Fri, 20 Oct 2023 13:10:53 +0100 Subject: [PATCH] fix: store document references as plain objects (#5021) --- .../desk/comments/src/__workshop__/CommentsListStory.tsx | 3 +-- .../src/desk/comments/src/hooks/useCommentOperations.ts | 3 +-- packages/sanity/src/desk/comments/src/types.ts | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/sanity/src/desk/comments/src/__workshop__/CommentsListStory.tsx b/packages/sanity/src/desk/comments/src/__workshop__/CommentsListStory.tsx index afe1a3eb705..f2819ee2c98 100644 --- a/packages/sanity/src/desk/comments/src/__workshop__/CommentsListStory.tsx +++ b/packages/sanity/src/desk/comments/src/__workshop__/CommentsListStory.tsx @@ -50,8 +50,7 @@ const BASE: CommentDocument = { _dataset: '1', _projectId: '1', _ref: '1', - _type: 'crossDatasetReference', - _weak: true, + _type: 'object', }, }, message: [ diff --git a/packages/sanity/src/desk/comments/src/hooks/useCommentOperations.ts b/packages/sanity/src/desk/comments/src/hooks/useCommentOperations.ts index 8b1380bc32d..2cc77ccfdb2 100644 --- a/packages/sanity/src/desk/comments/src/hooks/useCommentOperations.ts +++ b/packages/sanity/src/desk/comments/src/hooks/useCommentOperations.ts @@ -99,8 +99,7 @@ export function useCommentOperations( _dataset: dataset, _projectId: projectId, _ref: documentId, - _type: 'crossDatasetReference', - _weak: true, + _type: 'object', }, documentType, }, diff --git a/packages/sanity/src/desk/comments/src/types.ts b/packages/sanity/src/desk/comments/src/types.ts index c9921013784..3bc84f72a82 100644 --- a/packages/sanity/src/desk/comments/src/types.ts +++ b/packages/sanity/src/desk/comments/src/types.ts @@ -131,13 +131,11 @@ export interface CommentDocument { target: { path: CommentPath documentType: string - document: { _dataset: string - _projectId: string // verify + _projectId: string _ref: string - _type: 'crossDatasetReference' - _weak: true + _type: 'object' } } }