Skip to content

Commit

Permalink
added null checks so that it doesn't run if id is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiawei-Liao committed Aug 10, 2024
1 parent 710a1ab commit 947243a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ const useGetPropertyManagerByPropertyManagerID = (property_manager_id) =>{
setPropertyManager(data)
}
}

fetchPropertyManager()
if (property_manager_id) {
fetchPropertyManager()
}
}, [property_manager_id])
return property_manager
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ const useGetPropetyManagersByCompanyID = (company_id) =>{
setPropertyManagers(data)
}
}

fetchPropertyManagers()
if (company_id) {
fetchPropertyManagers()
}
}, [])
return property_managers
}
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/queries/Renter/useGetRenterByRenterID.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ const useGetRenterByRenterID = (renter_id) =>{
setRenter(data)
}
}

fetchRenter()
if (renter_id) {
fetchRenter()
}
}, [renter_id])
return renter
}
Expand Down

0 comments on commit 947243a

Please sign in to comment.