Untitled

 avatar
Anis
plain_text
24 days ago
500 B
0
Indexable
Never
router.post("/update", async (req, res, next) => {
  upload.fields([
    {
      name: "site_logo",
      maxCount: 1,
    },
    {
      name: "site_icon",
      maxCount: 1,
    },
  ])(req, res, async (err) => {
    if (err instanceof multer.MulterError) {
      console.error(err);
      return res.status(500).json({ error: "Multer error!" });
    } else if (err) {
      console.error(err);
      return res.status(500).json({ error: "Error uploading file!" });
    }
   })
}
Leave a Comment