-
Notifications
You must be signed in to change notification settings - Fork 27
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
Presson view profile Page and Side Bar #71
Presson view profile Page and Side Bar #71
Conversation
…tion about a specific profile such as their followers, who they follow, their posts, their likes and also displayed similar info on the side bar of the home page
const username = "chitchat-test"; | ||
const password = "7lBeZIE="; | ||
const credentials = encodeCredentials(username, password); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Presson-coder Can we fetch the profile details without hardcoding the credentials? The code should use the current user's credentials to make API requests instead of a hard-coded credential.
Can we save the credentials in a secure storage, retrieve them and pass them to the hook whenever it is called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oww on that one I needed the endpoint for login which I assume its not there yet. So when its there ,we will make that data dynamic and we will display the data of the currently logged in user and subsequently make requests using their respective credentials.
So on that one I was just doing it that way so that I make requests with the user you created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a login endpoint here: http://chitchat-api.vndprojects.com/api-auth/login/
I don't have a problem with testing auth using this user account. However, to test more securely, I suggest passing the credentials of whatever user we're using without hard-coding them.
@Presson-coder is this possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok sure thanks, I didn't know that the endpoint was there. Let me work on that and update you.
frontend/utils/data.ts
Outdated
"created_at": "2024-02-08T15:17:16.231555Z", | ||
"likes_count": 0 | ||
}, | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Presson-coder, is this for testing purposes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh that file! I was just using it to be seeing the nature of the endpoints and responses locally but otherwise is of no use ,could have deleted it after I was done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Presson-coder No problem, I understand. If you're using it for local testing, let's remove it from git while keeping it in your filesystem so you can continue to test against it. Do:
git rm --cached frontend/utils/data.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok sure thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Presson-coder Excellent work on this PR! I'm not fluent in React but this code looks good. I left some comments about how we're handling credentials and I'd like to hear your thoughts on identifying users.
I can't view any profile information when I view the UI locally. dev tools show an error when fetching the profile details at this URL:
http://localhost:5173/profile/undefined/profiles/6
I could be missing a configuration step here.
Then I don't know @terrameijar could the profiles endpoint return more data in the in the following and followers object e.g profile picture and bio or some data because currently we only have url and username. Except its fine like that "follows": [ |
Pull Request Title: Add Detailed User Profile Page and Sidebar Information
Description:
This pull request introduces a new view profile page that provides detailed information about a specific user profile. The page includes sections for followers, following, posts, and likes. Additionally, similar information is displayed on the sidebar of the home page.
Changes Made:
View Profile Page:
Home Page Sidebar:
Testing:
Additional Notes:
Let me know if you need any further adjustments!