You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
231 B
JavaScript

const Category = require('../models/category')
module.exports.all = (req, res) => {
Category.find().then((categories) => {
res.status(200).json(categories)
}).catch(err => {
res.status(400).json({ error: err.message })
})
}