👌 IMPROVE: GET /admin/functions/:slug

This commit is contained in:
Divlo
2020-04-15 16:40:09 +02:00
parent 5d791f34d6
commit 9336bf12fd
2 changed files with 7 additions and 5 deletions

View File

@ -63,10 +63,10 @@ exports.getFunctions = (req, res, next) => {
});
}
exports.getFunctionById = (req, res, next) => {
const { id } = req.params;
exports.getFunctionBySlug = (req, res, next) => {
const { slug } = req.params;
Functions.findOne({
where: { id },
where: { slug },
include: [
{ model: Categories, attributes: ["name", "color"] }
]