Skip to content

Feature/pre upload image api#22

Merged
boytur merged 14 commits intoDevelopmentfrom
feature/pre-upload-image-api
Feb 26, 2025
Merged

Feature/pre upload image api#22
boytur merged 14 commits intoDevelopmentfrom
feature/pre-upload-image-api

Conversation

@boytur
Copy link
Copy Markdown
Member

@boytur boytur commented Feb 26, 2025

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-cron package, creating a new Image model, implementing a cron job to delete unused images, and updating the PollService and related controllers to handle image uploads.

Package updates:

  • Added node-cron and @types/node-cron to backend/package.json and backend/package-lock.json for scheduling tasks. [1] [2] [3] [4]

Database schema changes:

  • Created a new Image model in backend/prisma/schema.prisma and added relevant migrations to handle image data. [1] [2] [3] [4] [5]

Cron job implementation:

  • Implemented a cron job in backend/src/crons/deleteUnusedImages.ts to delete unused images from the database and R2 storage. [1] [2] [3]

R2 service integration:

  • Added R2Service and R2Controller to handle image uploads, retrieval, and deletion. Updated PollService and 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.

@boytur boytur requested review from LordEaster and Maikiw7 February 26, 2025 07:47
@boytur boytur merged commit fd9b438 into Development Feb 26, 2025
@boytur boytur deleted the feature/pre-upload-image-api branch February 26, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant