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

Haoji create a cronjob for app to get profile images from website #591

Closed

Conversation

Haoj1
Copy link
Contributor

@Haoj1 Haoj1 commented Oct 29, 2023

Description

image

Related PRS (if any):

To test this backend PR you need to checkout the #1470 frontend PR.

Main changes explained:

  • Update package.json for Web Scraping tools
  • Update src/controllers/userProfileController.js for allowing url as a valid img source
  • Create a function updateProfilesPic in src/controllers/userProfileController.js for fetching the pictures from the sites
  • Update src/models/userProfile.js to allow temporarily store the possible pictures

How to test:

  1. check into current branch

  2. do npm install, npm run build and npm run start to run this PR locally

  3. log as owner user

  4. Feel free to change the cronjob period in src/cronjobs/userProfileJobs.js, the following change allows cronjob to run every minute

image
  1. If you do not want to modify others' profiles during testing, you can add a search keyword in src/helpers/userHelper.js like the following. That could make sure cronjob only works on your own created users.
image
  1. See how to test in frontend
  2. do git restore . to undo the changes

Screenshots or videos of changes:

Note:

See frontend

Copy link

@malikjahanzaib malikjahanzaib left a comment

Choose a reason for hiding this comment

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

Hi @Haoj1, check my FE review.

Copy link

@shubhankarval shubhankarval left a comment

Choose a reason for hiding this comment

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

Hey @Haoj1, just left a comment on FE PR #1470.

@Haoj1 Haoj1 added the Do Not Review Do not review or look at code without full context label Nov 5, 2023
@Haoj1 Haoj1 closed this Nov 12, 2023
@Haoj1
Copy link
Contributor Author

Haoj1 commented Nov 17, 2023

Hi @Haoj1, check my FE review.

Hi @malikjahanzaib, could you help me review the new PR with the same functions? #608 I have fixed this error and enabled email sender for alerting user to update their profile img

@Haoj1
Copy link
Contributor Author

Haoj1 commented Nov 17, 2023

Hey @Haoj1, just left a comment on FE PR #1470.

Hi @shubhankarval, would you mind helping me review the new PR with the same function?#591 (review). I have fixed the typo and enabled email sender for alerting user to update their profile img

@LunaticLeo LunaticLeo deleted the Haoji-Make-App-Get-Profile-Images-from-Website branch December 8, 2023 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do Not Review Do not review or look at code without full context
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants