const homepage = require('../../models/homepage');
const helper = require('../../helper');
const express = require("express");
const router = express.Router();
const app = express();
app.use(express.json());

router.post("/test", async (req, res, next) => {
     if(helper.check_headers(req) == "True"){
        var section1 = await  homepage.get_homepage_section1()
        //var section2 = await  homepage.get_homepage_section2()
        //var section3 = await  homepage.get_homepage_section2_heading()
        //section1.id = helper.encrypt(section1.id.toString());
        res.status(200).json({
            message: "Successfull",
            status: "True",
            data:{
                section1: section1,
               // section2: section2,
                //section3: section3,
            }
        });
     }else{
        res.status(200).json({
            message: "Unauthorised request",
            status: "Fail"
        });
     }
});

module.exports = router;