Skip to content

Commit 9f9919d

Browse files
fix(next): remove toString coercion inside getDocumentPermissions (#10828)
### What? When the doc permissions were retrieved from the DB, we were coercing them into strings even when they should not have been. ### Why? Usage of `id.toString()` ### How? Remove `id.toString()`. The id will be correct by this point and we should never coerce id's like this. Fixes #8218
1 parent 95e81d8 commit 9f9919d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/next/src/views/Document/getDocumentPermissions.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const getDocumentPermissions = async (args: {
3131
if (collectionConfig) {
3232
try {
3333
docPermissions = await docAccessOperation({
34-
id: id?.toString(),
34+
id,
3535
collection: {
3636
config: collectionConfig,
3737
},
@@ -46,7 +46,7 @@ export const getDocumentPermissions = async (args: {
4646

4747
if (collectionConfig.versions?.drafts) {
4848
hasPublishPermission = await docAccessOperation({
49-
id: id?.toString(),
49+
id,
5050
collection: {
5151
config: collectionConfig,
5252
},

0 commit comments

Comments
 (0)