Skip to content

Commit

Permalink
fix: autosave potentially losing latest: true w/ race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikrut committed Oct 28, 2024
1 parent a8569b9 commit 15f5e25
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/payload/src/versions/saveVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export const saveVersion = async ({

const data: Record<string, unknown> = {
createdAt: new Date(latestVersion.createdAt).toISOString(),
latest: true,
parent: id,
updatedAt: now,
version: {
...versionData,
Expand Down

0 comments on commit 15f5e25

Please sign in to comment.