Skip to content

Commit 3298113

Browse files
authored
fix(ui): pass correct relationTo to locked documents creation (#9137)
### What? Relationships within `payload-locked-documents` collection were stored incorrectly with `relationTo` as an array: <img width="316" alt="image" src="https://github.com/user-attachments/assets/f84b9807-6032-4ea2-8563-5c7d13306a4a"> Example how it should be: <img width="405" alt="image" src="https://github.com/user-attachments/assets/80fb54fd-7c2e-4c90-bd2b-dec8e7a06040"> This additionally caused issue that `value` wasn't converted to `ObjectID`
1 parent b878daf commit 3298113

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/ui/src/utilities/handleFormStateLocking.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ export const handleFormStateLocking = async ({
125125
data: {
126126
document: collectionSlug
127127
? {
128-
relationTo: [collectionSlug],
128+
relationTo: collectionSlug,
129129
value: id,
130130
}
131131
: undefined,
132132
globalSlug: globalSlug ? globalSlug : undefined,
133133
user: {
134-
relationTo: [req.user.collection],
134+
relationTo: req.user.collection,
135135
value: req.user.id,
136136
},
137137
},

0 commit comments

Comments
 (0)