const help = require('../../models/help');
const helper = require('../../helper');
const express = require("express");
const bodyParser = require("body-parser");
const router = express.Router();
const config = require("../../config")
//var jsonParser = bodyParser.json()
//var urlencodedParser = bodyParser.urlencoded({ extended: false })
const app = express();
app.use(express.json());

router.post("/help", async (req, res, next) => {
     if(helper.check_headers(req) == "True"){
        var faqs = await help.faqs()
        var heading = await help.heading()

        res.status(200).json({
            message: "Successfull",
            status: "True",
            data:{
                faqs: faqs,
                heading: heading,
            }
        });
     }else{
        res.status(200).json({
            message: "Unauthorised request",
            status: "Fail"
        });
     }
});

module.exports = router;