const Medicine = require("../models/medicine");



exports.getMedicines = (req, res, next) => {
 
  Medicine.find({})
    .then((medicines) => {
      res.status(200).json(medicines);
    })
    .catch((err) => {
      console.log(err);
    });
};


exports.getMedicineslist = (req, res, next) => {
 
  Medicine.find({}, { _id: 1, drugName: 1 })
    .then((medicines) => {
      res.status(200).json({medicinelist:medicines});
    })
    .catch((err) => {
      console.log(err);
    });
};
