Skip to content

Commit aef5d8b

Browse files
committed
feat(api): sync draft content to prevent false unpublished changes indicator
1 parent d3632a1 commit aef5d8b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

apps/app/src/actions/policies/create-new-policy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export const createPolicyAction = authActionClient
7171
frequency: Frequency.monthly,
7272
status: PolicyStatus.draft,
7373
content: initialContent,
74+
draftContent: initialContent, // Sync with content to prevent false "unpublished changes" indicator
7475
...(controlIds &&
7576
controlIds.length > 0 && {
7677
controls: {

apps/app/src/actions/policies/update-draft.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ export const updateDraftAction = authActionClient
111111
where: { id: policyId },
112112
data: {
113113
draftContent: draftContentToSave,
114-
// Clear signedBy when draft is updated
115-
signedBy: [],
114+
// Note: Do NOT clear signedBy here - signatures are for published content,
115+
// not drafts. Signatures are only cleared when content is actually published.
116116
},
117117
});
118118

0 commit comments

Comments
 (0)