This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoose, {Schema} from "mongoose" | |
const wallpaperschema = new Schema( | |
{ | |
title:{ | |
type:String, | |
unique:true, | |
required:true | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wallpaper from "../models/wallpaper.js"; | |
import { uploadOnCloudinary } from "../middlewares/cloudinary.js"; | |
const createwp = async (req, res) => { | |
try { | |
const { title, category, success } = req.body; | |
const imageFile = req.file?.path; | |
// console.log(req.body); | |
// console.log(imageFile); | |
// console.log(process.env.CLOUDINARY_API_KEY); |