Skip to content

Commit

Permalink
fix: unable to add/update unit number
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwan Rimorin John Eric authored and Kwan Rimorin John Eric committed Oct 17, 2023
1 parent d0c1bd1 commit 42a1c89
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/modal/updateunit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const UpdateUnit = NiceModal.create(
unitDisplay,
addressData
}: UpdateUnitModalProps) => {
const [unitSeq, setUnitSeq] = useState(unitSequence);
const [unitSeq, setUnitSeq] = useState<number | undefined>(unitSequence);
const [isSaving, setIsSaving] = useState(false);
const modal = useModal();
const rollbar = useRollbar();
Expand Down
16 changes: 8 additions & 8 deletions src/pages/dashboard/admin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,11 @@ function Admin({ user }: adminProps) {
clearInterval(pollerId);
if (snapshot.exists()) {
const postalSnapshot = snapshot.val();
console.log(postalSnapshot);
const floorData = await processAddressData(
code,
postalCode,
postalSnapshot.units
);
console.log(floorData);
const linkDetails = await processLinkDetails(code, postalCode);
const addressData = {
assigneeDetailsList: linkDetails.assigneeDetailsList,
Expand Down Expand Up @@ -1576,10 +1574,10 @@ function Admin({ user }: adminProps) {
{
footerSaveAcl: userAccessLevel,
name: currentPostalname,
congregation: code || "",
congregation: code,
postalCode: currentPostalcode,
currentFeedback: addressElement.feedback,
currentName: user.displayName || "",
currentName: user.displayName,
helpLink:
WIKI_CATEGORIES.CONDUCTOR_ADDRESS_FEEDBACK
}
Expand All @@ -1600,12 +1598,12 @@ function Admin({ user }: adminProps) {
ModalManager.show(
SuspenseComponent(UpdateAddressInstructions),
{
congregation: code || "",
congregation: code,
postalCode: currentPostalcode,
userAccessLevel: userAccessLevel,
addressName: currentPostalname,
instructions: addressElement.instructions,
userName: user.displayName || ""
userName: user.displayName
}
)
}
Expand Down Expand Up @@ -1676,7 +1674,8 @@ function Admin({ user }: adminProps) {
footerSaveAcl: userAccessLevel,
postalCode: currentPostalcode,
addressData: addressElement,
defaultType: policy.defaultType
defaultType: policy.defaultType,
congregation: code
})
}
>
Expand Down Expand Up @@ -1875,7 +1874,8 @@ function Admin({ user }: adminProps) {
unitno || "",
maxUnitNumberLength
),
addressData: addressElement
addressData: addressElement,
congregation: code
});
}}
handleFloorDelete={(event) => {
Expand Down

0 comments on commit 42a1c89

Please sign in to comment.