You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/api/src/policies/policies.service.ts
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1030,6 +1030,11 @@ export class PoliciesService {
1030
1030
1031
1031
if(!policy.pendingVersionId){
1032
1032
if(policy.approverId){
1033
+
if(policy.approverId!==dto.approverId){
1034
+
thrownewBadRequestException(
1035
+
'Only the assigned approver can accept changes',
1036
+
);
1037
+
}
1033
1038
awaitdb.policy.update({
1034
1039
where: {id: policyId},
1035
1040
data: {approverId: null},
@@ -1038,6 +1043,7 @@ export class PoliciesService {
1038
1043
'This policy has no pending changes to approve. The stale approval request has been cleared — please ask the policy owner to re-submit if a new approval is needed.',
1039
1044
);
1040
1045
}
1046
+
}
1041
1047
thrownewBadRequestException('No pending version to approve');
0 commit comments