Add WRAP ASYNC
const wrapAsync = require("./utils/wrapAsync.js");
WRAPASYNC.JS IS CREATED IN UTILS FOLDER
module.exports = (fn) => {
return function (req, res, next) {
fn(req, res, next).catch(next);
};
};
app.post("/listings", wrapAsync(async (req, res, next) => {


Comments
Post a Comment