const express = require('express');
const router = express.Router();

const { uploadWebsite } = require('../config/cloudinaryUpload');

const { asyncHandler, authUser, authAdmin } = require('../auth/checkAuth');

const websiteController = require('../controller/website.controller');

router.get('/website', asyncHandler(websiteController.getWebsite));
router.put(
    '/website',
    uploadWebsite.fields([{ name: 'logo' }, { name: 'favicon' }, { name: 'banner', maxCount: 10 }]),
    authAdmin,
    asyncHandler(websiteController.updateWebsite),
);

router.get('/top-deposit', asyncHandler(websiteController.topDeposit));

module.exports = router;
