This pull request introduces the integration of Cloudinary for handling image uploads in our Next.js application. It modifies the signup route to upload user profile images to Cloudinary and adds a new route for updating user profiles, including the ability to update the profile image.
Summary
Added Cloudinary configuration to both the signup and updateProfile routes to enable image uploads.
In the signup route:
Extracted the image file from the request and uploaded it to Cloudinary.
Stored the returned image URL in the newUser object before saving it to the database.
Created a new updateProfile route that allows users to update their username, email, and profile image.
This route also uploads the new image to Cloudinary and updates the user's profile with the new image URL if an image is provided.
Utilized environment variables (CLOUDINARY_CLOUD_NAME, CLOUDINARY_API_KEY, CLOUDINARY_API_SECRET) for Cloudinary configuration to keep sensitive information secure.
Adjusted import statements in the signup route to use absolute path aliases for better readability and maintainability.
Modified Files:
src/app/api/users/signup/route.ts
src/app/api/users/updateProfile/route.ts
Added Dependencies:
cloudinary: For uploading images to Cloudinary.
This setup enhances the user experience by allowing profile images to be uploaded and stored efficiently, leveraging Cloudinary's robust cloud-based image management capabilities.
Fixes #17.
🎉 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.
Description
This pull request introduces the integration of Cloudinary for handling image uploads in our Next.js application. It modifies the signup route to upload user profile images to Cloudinary and adds a new route for updating user profiles, including the ability to update the profile image.
Summary
signup
andupdateProfile
routes to enable image uploads.signup
route:newUser
object before saving it to the database.updateProfile
route that allows users to update their username, email, and profile image.CLOUDINARY_CLOUD_NAME
,CLOUDINARY_API_KEY
,CLOUDINARY_API_SECRET
) for Cloudinary configuration to keep sensitive information secure.signup
route to use absolute path aliases for better readability and maintainability.Modified Files:
src/app/api/users/signup/route.ts
src/app/api/users/updateProfile/route.ts
Added Dependencies:
cloudinary
: For uploading images to Cloudinary.This setup enhances the user experience by allowing profile images to be uploaded and stored efficiently, leveraging Cloudinary's robust cloud-based image management capabilities.
Fixes #17.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: