Skip to content

Commit

Permalink
add console.error to ApplicationStepPage and allow staff users to con…
Browse files Browse the repository at this point in the history
…tinue with policy violations in ApplicationForm
  • Loading branch information
glen-aot committed Dec 12, 2024
1 parent ebefc55 commit 102aba8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export const ApplicationStepPage = ({
!companyId ||
!isPermitTypeAllowed()
) {
console.error("The application cannot be displayed or edited");
return <Navigate to={ERROR_ROUTES.UNEXPECTED} />;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ export const ApplicationForm = ({
// When "Continue" button is clicked
const onContinue = async (data: ApplicationFormData) => {
const updatedViolations = await triggerPolicyValidation();
if (Object.keys(updatedViolations).length > 0) {
// prevent CV client continuing if there are policy engine validation errors
if (Object.keys(updatedViolations).length > 0 && !isStaffUser) {
return;
}

Expand Down

0 comments on commit 102aba8

Please sign in to comment.