sj030 / Tooktak

산학협력프로젝트 과목 (3230) 팀프로젝트입니다.
0 stars 4 forks source link

then() 사용 #55

Closed window9u closed 3 months ago

window9u commented 3 months ago

https://github.com/sj030/Tooktak/blob/b6804e6e7e816d5ccedfbcfe68ca9cac65a0b788/backend/routes/file.js#L42

router.post("/search", (req, res) => {
    ServiceAttrService.getServiceByName(req.body.name)
        .then(service => FileService.getAllMetaDataByQuery(service, req.body.attributes))
        .then(result => {
            res.status(200).send(result);
        })
        .catch(error => {
            res.status(500).send(error.message);
        });
});

이런 방식으로 쓰는 것이 좋아 보입니다.

dldyou commented 3 months ago

56 적용 완료되었습니다.