Skip to content

Commit

Permalink
Custom error message when title or subtitle fields are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
r800360 committed Jun 4, 2024
1 parent 2126caa commit 8d6e677
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions admin-portal-frontend/src/app/pages/EmergencyFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,18 @@ const EmergencyFlow: React.FC = () => {
// If the problem is something we don't really control, such as network
// issues or an unexpected exception on the server side, then use a
// banner, modal, popup, or similar.

alert(result.error);
if (
!emergencyTitle ||
emergencyTitle == "" ||

Check failure on line 135 in admin-portal-frontend/src/app/pages/EmergencyFlow.tsx

View workflow job for this annotation

GitHub Actions / Admin portal frontend lint and style check

Expected '===' and instead saw '=='
emergencyTitle === "" ||
!emergencySubtitle ||
emergencySubtitle == "" ||

Check failure on line 138 in admin-portal-frontend/src/app/pages/EmergencyFlow.tsx

View workflow job for this annotation

GitHub Actions / Admin portal frontend lint and style check

Expected '===' and instead saw '=='
emergencyTitle === ""
) {
alert("Missing required title or subtitle fields. Please resubmit the form.");
} else {
alert(result.error);
}
console.log(result);
}
})
Expand Down

0 comments on commit 8d6e677

Please sign in to comment.