Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Users to Save Landlord And Apartments #334

Merged
merged 5 commits into from
Dec 1, 2023

Conversation

AnkitLakkapragada
Copy link
Contributor

@AnkitLakkapragada AnkitLakkapragada commented Dec 1, 2023

Summary

This pull request allows users to save landlords and apartments. The implementation is spread out through several different parts.

Backend

  • In the backend, two new endpoints are created. The endpoints are "check-saved-apartment" and "check-saved-landlord." The purpose of these two endpoints is for every apartment when rendered, to check if it has been saved so we can update the icon accordingly. This way, if a user has saved an apartment/landlord, the default icon will be that it is saved, and if clicked, it will unsave.

Frontend

  • The frontend has several different changes. The main changes occurred in ApartmentCard, ApartmentPage, and LandlordPage. In each of these, a saved/unsaved icon button was placed to allow users to save or unsave their apartment. Additionally, the API mentioned above was called to pick the right icon to show the user.

A problem I ran into is that in ApartmentCard, we need user credentials, however, they aren't passed through Props. So I had to update ApartmentCard and all parent files that used it or its parents to pass through the user from App.tsx. This means that some files that seemed unrelated were modified because they eventually called a parent of ApartmentCard like ApartmentCards.

Test Plan

Testing was done through mobile and web changes. API's were tested and followed almost identical format as other heavily tested endpoints. Additionally, all functionality was verified by manually looking into Firebase. A video below demonstrates the functionality:

p1.mov
p2.mov

Notes

None

Breaking Changes

None

@dti-github-bot
Copy link
Member

dti-github-bot commented Dec 1, 2023

[diff-counting] Significant lines: 370.

Copy link

github-actions bot commented Dec 1, 2023

Visit the preview URL for this PR (updated for commit 58c19a2):

https://cu-apts-staging--pr334-save-apartment-landl-k9khkouq.web.app

(expires Fri, 08 Dec 2023 21:58:07 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 096ac87b789b31770a01964fe0aaa92d563b9353

@AnkitLakkapragada AnkitLakkapragada changed the title Saving Landlord & Apartment Allow Users to Save Landlord And Apartments Dec 1, 2023
@AnkitLakkapragada AnkitLakkapragada self-assigned this Dec 1, 2023
Copy link
Contributor

@cyrus14 cyrus14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ankit, excellent work on the pull request! Your implementation to save landlords and apartments is both well-structured and efficiently designed. I appreciate the modular approach you took, especially in the backend with the creation of the "check-saved-apartment" and "check-saved-landlord" endpoints. This not only enhances code readability but also makes it easier to maintain and extend in the future. Your changes in the frontend, particularly in ApartmentCard, ApartmentPage, and LandlordPage, showcase a thoughtful integration of saved/unsaved icon buttons, providing users with a seamless experience. The attention to detail in handling user credentials in ApartmentCard and addressing related modifications in parent files demonstrates a keen understanding of the codebase. Your comprehensive test plan, covering both mobile and web changes, along with meticulous API testing and manual verification in Firebase, ensures the robustness of the functionality. Overall, great job on delivering a well-crafted and thoroughly tested solution!

Copy link
Contributor

@jesshan700 jesshan700 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Ankit! Great job on this pull request - incorporating the functionality to save landlord and apartments is a feature that will enhance the user experience with CUApts! The code looks good and great job on implementing both the backend and frontend of this task.

Copy link
Collaborator

@thuypham03 thuypham03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! In the future, we can consider converting user to a global context to prevent duplicating code of passing user to every component that we have.

@AnkitLakkapragada AnkitLakkapragada merged commit 6de4d2d into main Dec 1, 2023
7 checks passed
@AnkitLakkapragada AnkitLakkapragada deleted the save-apartment-landlord branch December 1, 2023 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants