Added logic to delete old profile image as user add new profile image #204
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #200
Description
I added logic to delete the old profile image of the user from storage as the user change or add a new profile image. This way we can maintain the usage of Storage and reduce the redundancy of profile images.
I tried other ways like storing image using user uid or email but it didn't work well so at last,
I created a new attribute in User Docs in the Database to store the UserProfileImageID and used it to delete the Old user image.
I used DateTime millieSecondsSinceEpoch as a Unique ID for the profile image.
Type of change
How Has This Been Tested?
Everything at the front end and the database works fine. Shared some screenshots and screen-recording to review the changes.
Screen recordings
screen.recording.mp4
Checklist:
Maintainer Checklist
@chandansgowda Please review this.