This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
FunctionProject/backend/controllers/categories.js
Divlo c9f817930c backend: Ajout de Sequelize, GET /functions
TODO: Trier par catégorie et chercher les fonctions
2020-03-20 16:49:45 +01:00

13 lines
392 B
JavaScript

const errorHandling = require('../assets/utils/errorHandling');
const Categories = require('../models/categories');
exports.getCategories = (_req, res, next) => {
Categories.findAll()
.then((result) => {
res.status(200).json(result);
})
.catch((error) => {
console.log(error);
errorHandling(next, serverError);
});
}