const { BusStops } = require('../../models');
const { formatCase } = require('../../util/formatter');

exports.busStops = async (req, res, next) => {
	try {
		const stops = await BusStops.findAll();

		return res.status(200).json({
			success: true,
			data: formatCase(stops.map((stop) => stop.get({ plain: true }))),
		});
	} catch (error) {
		next(error);
	}
};
