use assignment in conditionals

As discussed in [this PR](https://github.com/HouseTrip/HouseTrip-Web-App/pull/3370#discussion-diff-6712854) we may want to remove this point :palm_tree: