diff --git a/components/category/categoryService.js b/components/category/categoryService.js index a5b3552..dc773f4 100644 --- a/components/category/categoryService.js +++ b/components/category/categoryService.js @@ -4,3 +4,8 @@ const AppError = require('../../globalErrorHandler/AppError') module.exports.getAllCategories = async () => { return Category.find().populate('parentId') } + +module.exports.createCategory = async (data) => { + const category = Category.create(data, null) + return category +}