After successfully implementing image uploads in cloudinary for Next.js, I encountered an issue with image deletion. Despite creating the necessary routes and components, the deletion functionality is not working as expected. I am unsure of what could be causing this problem.
api/upload/route.js
import { NextResponse } from "next/server";
import sha1 from "sha1";
export async function POST(req) {
...
}
export async function DELETE(req) {
...
}
component/UploadedImages.js
"use client";
import { useState, useRef } from "react";
import Image from "next/image";
const ImageUploader = () => {
...
};
export default ImageUploader;