const express = require('express');
const router = express.Router();
const upload = require('../config/multer'); // Import multer config
const companyController = require('../controllers/companyController');

// Get all companies
router.get('/', companyController.getCompanies);
router.get('/one/', companyController.getCompany);

// Add a new company
router.post('/', upload.single('companyImage'),companyController.createCompany);

// Update a company by ID
router.put('/:id',upload.single('companyImage'), companyController.updateCompany);

// Delete a company by ID
router.delete('/:id', companyController.deleteCompany);


const { getCollections, getCompanies, deleteSelectedCollections } = require('../controllers/collectionController');

// Route to fetch all collections
router.get('/collections', getCollections);

// Route to fetch all companies
router.get('/companies', getCompanies);

// Route to delete selected collections for a specific company
router.post('/delete-collections', deleteSelectedCollections);

module.exports = router;






module.exports = router;
