This pull request introduces functionality for uploading user images to Cloudinary and updating the user's avatar URL in the database. It includes backend changes to handle image uploads on the POST request and utility function for Cloudinary integration.
Summary
Added a new utility function uploadImageToCloudinary in src/lib/database/helpers/uploadImageToCloudinary.ts for uploading images to Cloudinary.
Configured Cloudinary in the new utility file using environment variables for cloud_name, api_key, and api_secret.
Implemented a POST handler in src/app/api/users/me/route.ts to:
Extract the user ID from the token.
Validate the presence of an image file in the request.
Utilize uploadImageToCloudinary to upload the image.
Update the user's avatar URL in the database with the returned Cloudinary URL.
Handle errors and respond accordingly.
Ensured database connection initialization at the beginning of the route file.
Fixes #20.
🎉 Latest improvements to Sweep:
New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
PR Feedback (click)
Description
This pull request introduces functionality for uploading user images to Cloudinary and updating the user's avatar URL in the database. It includes backend changes to handle image uploads on the POST request and utility function for Cloudinary integration.
Summary
uploadImageToCloudinary
insrc/lib/database/helpers/uploadImageToCloudinary.ts
for uploading images to Cloudinary.cloud_name
,api_key
, andapi_secret
.src/app/api/users/me/route.ts
to:uploadImageToCloudinary
to upload the image.Fixes #20.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can:
This is an automated message generated by Sweep AI.