Skip to content

Commit

Permalink
Merge pull request #282 from rimorin/staging
Browse files Browse the repository at this point in the history
Staging -> Master
  • Loading branch information
rimorin authored Apr 30, 2024
2 parents 583d467 + 3eb5369 commit c740f97
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/modal/newunit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ const NewUnit = NiceModal.create(
event.preventDefault();
setIsSaving(true);
try {
if (!/^[a-zA-Z0-9]+$/.test(unit)) {
alert(
"The Unit/Property number should only include alphanumeric characters."
);
return;
}
processPostalUnitNumber(
congregation,
postalCode,
Expand All @@ -53,7 +59,9 @@ const NewUnit = NiceModal.create(
{`Add ${
addressData.type === TERRITORY_TYPES.PRIVATE ? "property" : "unit"
} to ${
addressData.type === TERRITORY_TYPES.PRIVATE ? name : postalCode
addressData.type === TERRITORY_TYPES.PRIVATE
? addressData.name
: postalCode
}`}
</Modal.Title>
{addressData.type === TERRITORY_TYPES.PRIVATE ? (
Expand Down

0 comments on commit c740f97

Please sign in to comment.