Skip to content

Commit 74c7808

Browse files
committed
bugfix to allow an empty field for propertyID
1 parent ab45c1f commit 74c7808

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/views/AddTenant/addTenant.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const AddTenant = () => {
147147
setIsValidationActive(true);
148148

149149
if (dateTimeStart !== dateTimeEnd) {
150-
setPropertyErrorText(dateTimeStart !== dateTimeEnd && propertySelection && propertySelection.length
150+
setPropertyErrorText(dateTimeStart !== dateTimeEnd && propertySelection.length
151151
? ""
152152
: "*Property is a required field"
153153
);
@@ -175,7 +175,7 @@ export const AddTenant = () => {
175175
...values,
176176
occupants: values.occupants || null,
177177
unitNum: values.unitNum || null,
178-
propertyID: propertySelection[0].key,
178+
propertyID: propertySelection.length ? propertySelection[0].key : null,
179179
staffIDs: staffSelections && staffSelections.map(staff => staff.key)
180180
};
181181
if (dateTimeStart !== dateTimeEnd) {

0 commit comments

Comments
 (0)