Skip to content

Commit 4241811

Browse files
authored
fix: sorting by id incorrectly orders by version.id (#8442)
fixes #7187
1 parent 8110cb9 commit 4241811

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/payload/src/versions/drafts/getQueryDraftsSort.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,9 @@ export const getQueryDraftsSort = (sort: string): string => {
1515
orderBy = sort.substring(1)
1616
}
1717

18+
if (orderBy === 'id') {
19+
return `${direction}parent`
20+
}
21+
1822
return `${direction}version.${orderBy}`
1923
}

0 commit comments

Comments
 (0)