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

Old Post image updation #852

Merged
merged 7 commits into from
Jul 18, 2023
Merged

Conversation

Palakkgoyal
Copy link
Contributor

@Palakkgoyal Palakkgoyal commented Jul 17, 2023

This PR closes issue no. #556
Initially, I was going to dynamically fetch data for post header but I found that it will take too many requests. I mean a seperate request for every post and whenever the home page re-render it fetches again.
So, instead I added static data and in the profile page whenever the user update image then, I made it so that the all posts image also get updated. Along with that I saw that image in the users collection was not getting updated so, I also updated that.

In addition to all this, I also did some other changes, such as dynamically rendering routes for user profile. So, before the url was:
/dummygram/profile and it was using some states to check whether it current user or not. Instead I made the url this:
/dummygram/:username Hence, we don't need to pass anything while routing. User can also share their profile link unlike before. And I checked everything(I think so).

NOTE: This might not work with old posts but absolutely fine with new posts.
Pleas merge it as soon as possible as my score is going down and very less days are remaining. @narayan954

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you Palakkgoyal! for creating this pull request and contributing to Dummygram! 💗

The maintainers will review this Pull Request and provide feedback as soon as possible! 😇
We appreciate your patience and contribution, Keep up the great work! 😀

@narayan954
Copy link
Owner

This PR closes issue no. #556 Initially, I was going to dynamically fetch data for post header but I found that it will take too many requests. I mean a seperate request for every post and whenever the home page re-render it fetches again. So, instead I added static data and in the profile page whenever the user update image then, I made it so that the all posts image also get updated. Along with that I saw that image in the users collection was not getting updated so, I also updated that.

In addition to all this, I also did some other changes, such as dynamically rendering routes for user profile. So, before the url was: /dummygram/profile and it was using some states to check whether it current user or not. Instead I made the url this: /dummygram/:username Hence, we don't need to pass anything while routing. User can also share their profile link unlike before. And I checked everything(I think so).

NOTE: This might not work with old posts but absolutely fine with new posts. Pleas merge it as soon as possible as my score is going down and very less days are remaining. @narayan954

reviewing this

Copy link
Owner

@narayan954 narayan954 left a comment

Choose a reason for hiding this comment

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

image is not getting updated in preview as well as after upload in the profile image. It updates only after a refresh. sidebar and posts are fine.
image

@Palakkgoyal
Copy link
Contributor Author

Palakkgoyal commented Jul 18, 2023

This bug is not because of me. It exists already and I think someone has sent a PR for it. If you want I can work on this as well.

@narayan954
Copy link
Owner

narayan954 commented Jul 18, 2023

This bug is not because of me. It exists already and I think someone has sent a PR for it. If you want I can work on this as well.

right right, it's alright i'll merge that later

@Palakkgoyal
Copy link
Contributor Author

This bug is not because of me. It exists already and I think someone has sent a PR for it. If you want I can work on this as well.

right right, it's alright i'll merge that later

Ohk sure and you can also write right*2(I'll understand)

Copy link
Owner

@narayan954 narayan954 left a comment

Choose a reason for hiding this comment

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

looks good to me!

This was linked to issues Jul 18, 2023
@narayan954 narayan954 merged commit 97de451 into narayan954:master Jul 18, 2023
4 of 5 checks passed
@Palakkgoyal Palakkgoyal deleted the postImage branch July 18, 2023 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[BUG]: Profile route issue Image is not updated in old posts
2 participants