const {
  getChairmanProfile,
  getChairMessage,
  getChairSpeech,
  getChairPresentation,
  getChairInterviewPrint,
  getChairInterviewElectronic,
} = require("../utils/getQuery");

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

// Get Profile Data
router.get("/profile", async (req, res) => {
  try {
    const profileData = await getChairmanProfile();
    res.status(200).json(profileData);
  } catch (error) {
    res.status(500).json(error);
  }
});

// Chairman Message
router.get("/message", async (req, res) => {
  try {
    const data = await getChairMessage();
    res.status(200).json(data);
  } catch (error) {
    res.status(500).json(error);
  }
});

// Chairman Message
router.get("/speech", async (req, res) => {
  try {
    const data = await getChairSpeech();
    res.status(200).json(data);
  } catch (error) {
    res.status(500).json(error);
  }
});

// Chairman Presentation
router.get("/presentation", async (req, res) => {
  try {
    const data = await getChairPresentation();
    res.status(200).json(data);
  } catch (error) {
    res.status(500).json(error);
  }
});

// Chairman Interview Print
router.get("/interview_print", async (req, res) => {
  try {
    const data = await getChairInterviewPrint();
    res.status(200).json(data);
  } catch (error) {
    res.status(500).json(error);
  }
});

// Chairman Interview Electronic
router.get("/interview_electronic", async (req, res) => {
  try {
    const data = await getChairInterviewElectronic();
    res.status(200).json(data);
  } catch (error) {
    res.status(500).json(error);
  }
});

module.exports = router;
