We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eebef92 commit a5ddcbfCopy full SHA for a5ddcbf
1 file changed
apps/app/src/actions/policies/set-active-version.ts
@@ -39,6 +39,11 @@ export const setActiveVersionAction = authActionClient
39
return { success: false, error: 'Policy not found' };
40
}
41
42
+ // Prevent activating a different version when another is pending approval
43
+ if (policy.pendingVersionId && policy.pendingVersionId !== versionId) {
44
+ return { success: false, error: 'Another version is already pending approval' };
45
+ }
46
+
47
// Get version to activate
48
const version = await db.policyVersion.findUnique({
49
where: { id: versionId },
0 commit comments