Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted all Assests to .webp format #261

Open
wants to merge 5 commits into
base: staging
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions app/(default)/api/leads/upload/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,66 +9,6 @@ import { UploadApiResponse } from "cloudinary";
* @param {Request} request - The incoming HTTP request
* @returns {Promise<Response>} - A response containing the uploaded image URL or an error message
*/
/**
* @swagger
* /api/upload:
* post:
* summary: Uploads an image to Cloudinary.
* description: Receives an image file and uploads it to Cloudinary, returning the secure URL of the uploaded image.
* tags:
* - Upload
* requestBody:
* required: true
* content:
* multipart/form-data:
* schema:
* type: object
* properties:
* file:
* type: string
* format: binary
* description: The image file to be uploaded.
* name:
* type: string
* description: The desired name of the file in storage.
* responses:
* 200:
* description: Image uploaded successfully.
* content:
* application/json:
* schema:
* type: object
* properties:
* imageUrl:
* type: string
* example: "https://res.cloudinary.com/your-cloud-name/image/upload/v1234567890/images/image.jpg"
* 400:
* description: Bad request, file or name not provided.
* content:
* application/json:
* schema:
* type: object
* properties:
* message:
* type: string
* example: "Bad Request"
* details:
* type: string
* example: "File and name are required"
* 500:
* description: Internal server error during the upload process.
* content:
* application/json:
* schema:
* type: object
* properties:
* message:
* type: string
* example: "Cloudinary Upload Failed"
* details:
* type: string
* example: "Unknown upload error"
*/
export async function POST(request: Request): Promise<Response> {
try {
// Parse the form data from the incoming request
Expand Down