const { error, success } = require("../../handlers");
const { Contact } = require("../../models");

const addContactUs = async (req, res) => {
  try {
    let payload = req.body;
    await Contact.create(payload);

    return success(res, {
      msg: "Contact details saved we will back to you!!",
    });
  } catch (err) {
    console.log(err);
    return error(res, {
      msg: "Something went wrong!!",
    });
  }
};

module.exports = {
  addContactUs,
};
