diff --git a/BackendJS/BackendTS/routes/navigation.js b/BackendJS/BackendTS/routes/navigation.js index 351eced..45f92ca 100644 --- a/BackendJS/BackendTS/routes/navigation.js +++ b/BackendJS/BackendTS/routes/navigation.js @@ -417,8 +417,16 @@ router.get('/:startX/:startY/:endX/:endY/:type', (req, res) => __awaiter(void 0, method: 'GET' }, function (error, response, body) { return __awaiter(this, void 0, void 0, function* () { + if (JSON.parse(body).hasOwnProperty("error")) { + console.error(JSON.parse(body).error); + return res.status(500).json({ + error: JSON.parse(body).error + }); + } //JSON parse const NavigationList = JSON.parse(body).result; + //console.log(error); + //console.log(response); //1. 도보 시간, 2. 환승 개수, 3. 총 이동 시간 NavigationList.path.sort((a, b) => { if (a.info.totalWalk === b.info.totalWalk) { diff --git a/BackendTS/routes/navigation.ts b/BackendTS/routes/navigation.ts index 6ba03bd..43ea2cd 100644 --- a/BackendTS/routes/navigation.ts +++ b/BackendTS/routes/navigation.ts @@ -416,10 +416,20 @@ router.get('/:startX/:startY/:endX/:endY/:type',async(req:Request,res:Response)= method: 'GET' }, async function (error:Error, response:any, body:string) { + if(JSON.parse(body).hasOwnProperty("error")){ + console.error(JSON.parse(body).error); + return res.status(500).json({ + error: JSON.parse(body).error + }) + } + //JSON parse const NavigationList:NavigationResult = JSON.parse(body).result; - + //console.log(error); + //console.log(response); + + //1. 도보 시간, 2. 환승 개수, 3. 총 이동 시간 NavigationList.path.sort((a:NavigationPath, b:NavigationPath)=>{ if(a.info.totalWalk === b.info.totalWalk){