Merged
Conversation
…Option, WhitelistUser, Guest, VoteRestriction, Vote, FailedJob, and Image tables with necessary constraints and indexes
…age.json and package-lock.json
…itialize cron jobs
…e poll creation validation
…rieval, and deletion; add cron job for unused image cleanup
…troller for enhanced file handling
…andling and update poll creation logic
… R2 with error handling
… structure and upload logic
… guest votes in myVotedPolls method
… and improve error handling during publishing
…ploader and PollOption components
…nclude votes in poll data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request includes several changes to the backend of the project, focusing on adding support for image management, scheduling cron jobs, and integrating the R2 service. The most important changes include adding the
node-cronpackage, creating a newImagemodel, implementing a cron job to delete unused images, and updating thePollServiceand related controllers to handle image uploads.Package updates:
node-cronand@types/node-crontobackend/package.jsonandbackend/package-lock.jsonfor scheduling tasks. [1] [2] [3] [4]Database schema changes:
Imagemodel inbackend/prisma/schema.prismaand added relevant migrations to handle image data. [1] [2] [3] [4] [5]Cron job implementation:
backend/src/crons/deleteUnusedImages.tsto delete unused images from the database and R2 storage. [1] [2] [3]R2 service integration:
R2ServiceandR2Controllerto handle image uploads, retrieval, and deletion. UpdatedPollServiceand related controllers to use the new R2 service. [1] [2] [3] [4] [5] [6] [7] [8] [9]These changes collectively enhance the backend by adding robust image management capabilities and ensuring that unused images are automatically cleaned up.