ADD: get all categories logic

This commit is contained in:
MohammadHMazarei
2024-12-29 19:44:47 +03:30
parent ef71b0415f
commit 6e6c409201
+6
View File
@@ -0,0 +1,6 @@
const Category = require('./categoryModel')
const AppError = require('../../globalErrorHandler/AppError')
module.exports.getAllCategories = async () => {
return Category.find().populate('parentId')
}