category.controller.js 563 Bytes
Newer Older
kusang96's avatar
kusang96 committed
1
2
3
import Category from "../schemas/Category.js";

const getCategory = async (req, res) => {
이재연's avatar
0115    
이재연 committed
4
    console.log("dsadd=")
kusang96's avatar
kusang96 committed
5
6
7
8
9
10
11
12
13
    try {
        const category = await Category.find({}, {_id: 0})
        res.json(category)
    } catch (error) {
        console.log(error)
        res.status(500).send('카테고리 검색 실패')
    }
}

이재연's avatar
0115    
이재연 committed
14
15
16
17
18
19
20
21
22
23
24
25
26
const getSubCategory=(req,res)=>{
    
}

const getsubId=(req,res,next,sub)=>{
    const subcategory = await category.find({"Dress"})
    console.log('sub=',sub)

    next()
}


export default { getCategory , getsubId, getSubCategory}