diff --git a/components/category/categoryService.js b/components/category/categoryService.js index e69de29..a5b3552 100644 --- a/components/category/categoryService.js +++ b/components/category/categoryService.js @@ -0,0 +1,6 @@ +const Category = require('./categoryModel') +const AppError = require('../../globalErrorHandler/AppError') + +module.exports.getAllCategories = async () => { + return Category.find().populate('parentId') +}