You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found the source of this bug but making modifications to correct/avoid it will change the behavior of the “Room Api List” page that uses the Django REST framework.
It appears from the RoomApiList.filter_queryset() method inside the module “modernomad/core/views/booking.py” that it is implemented to send a rooms information to the Api page only if the room is fully available within the arrive and depart dates in the Daterangeselector.
In RoomIndexOrDetail.jsx the fetchRooms method assigns to this.state.rooms the information that is in the Room Api page. If there is at least 1 room available during those dates then the AvailabilityMatrix.jsx renders the information for that 1 room. But if none of the rooms are available then this.state.rooms is set to an empty list which then sets this.props.rooms to an empty list. What happens next is that line 38 of the AvailabilityMatrix.jsx file will attempt to index that empty list.
Edit: @bfirsh after revisiting this comment I realize that instead of commenting out lines of code, the best course of action is to refactor the methods in class RoomApiList. Beforehand, this will require a discussion between members of this repo about how to handle the interactions with the API. Best of luck with this app and hopefully I pointed in the right direction to help fix this bug.
Steps to reproduce:
There is error in console.
The text was updated successfully, but these errors were encountered: