images.routes.js 543 B

1234567891011
  1. import express from 'express';
  2. import { upload, uploadSingleImage, deleteSingleImage, deleteAllImagesFromCategory, copyImagesForCategory } from "../controllers/images.controllers.js";
  3. const router = express.Router();
  4. router.post('/addImage/:folder', upload.single('image'), uploadSingleImage);
  5. router.post('/deleteImage', deleteSingleImage);
  6. router.post('/deleteAllImagesFromCategory/:category/:id', deleteAllImagesFromCategory);
  7. router.post('/copyImagesFromCategory/:category/:oldId/:newId', copyImagesForCategory);
  8. export default router;