skip to Main Content

Javascript – ValidationError: Collection2 validation failed: name: Path `name` is required., email: Path `email` is required., message: Path `message` is required

I have to receive message from the visitor on the website const mongoose = require("mongoose"); mongoose.connect("mongodb+srv://hello:[email protected]/") .then(() => { console.log("mongodb connected"); }) .catch(() => { console.log("failed to connect"); }); const LoginSchema = new mongoose.Schema({ name: { type: String, required: true…

VIEW QUESTION

Javascript – Trying to load base 64 image in nextjs

I uploaded my image in this way and this method works, it uploads in a string: const [image, setImage] = useState(""); //------------------^^^^^^^^^^^^^^^^------------------------- const handleImage = (e) => { console.log("Handle image called"); const selectedFile = e.target.files[0]; console.log("Selected file:", selectedFile); if (selectedFile)…

VIEW QUESTION
Back To Top
Search